-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to link shared library in compiling #28
Comments
Hi @HiroiImanishi , paths in |
Hi @mat-hek , thank you for comment.
Why isn't NIF library be loaded ? |
Your |
Sorry for my omission, |
Ok, I think I see your actual problem - you link a shared library, that is loaded in runtime by the OS, which assumes such libraries are located in specific places, as described e.g. here. You should either place your library there or use a statically-linked library ( |
Hi, @mat-hek. Actually, I thought that there was no problem just linking libraries "-L" option. I understood what is the reason of this error. I tried to edit |
Excuse me, I have a question.
When $ mix compile, I would like to link shared library(.so).
For example, I'd like to add "-L project_root/c_src/example/c_libs -ltest" to command to make.
├── _build
├── c_src
│ └── example
│ ├── c_libs
│ │ └─libtest.so
│ ├── _generated
│ ├example.spec.exs
│ ├example.c
│ └ example.h
├── bundlex.exs
├── deps
├── lib
└── test
I tried to edit bundlex.exs as follows:
in result, I had a error
/usr/bin/ld: cannot find -ltest
collect2: error: ld returned 1 exit status
...
What is missing in this setting?
The text was updated successfully, but these errors were encountered: