dart-lang / dart-lang/native

[ffi] pthread_mutex_t variable defined in main causing dlopen failed: cannot locate symbol error

Open
#1,070 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
275
Forks
144
Avg merge
2d 10h
Merged PRs (30d)
47

Description

I loaded the pre-compiled libmylib.so including the libc++_shared.so in flutter android.
Inside the main.cpp
I have a variable defined like the following.

`pthread_mutex_t stratum_work_lock;`

I created the ffi for main only.
`int main(int argc, char *argv[])`
When running the .so file, I got this error
` dlopen failed: cannot locate symbol "stratum_sock_lock"`

I wonder what's causing the error or if I'm missing something.

I only need to exposed the main method as it's all I need to call.
Any pointers would be appreciated.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.