JNA加载具有依赖关系的库
我需要创建一个使用另一个 .so 库的原始 .so 库(C 代码)。创建 .so 库后,我在 C 上编写了一个简短的测试程序代码,用于调用我的库的函数。它可以工作,但是当我编译这个程序时,我使用该命令:
gcc my_test.c -lm -o my_test_program -lmy_lib -lother_lib -L
我需要在 Java 代码(JNA)中使用我的库,但是当我尝试从我的库调用函数时,我收到此错误:
/usr/lib64/libmy_lib.so.0:未定义的符号
我认为这意味着它失去了对 other_lib 的依赖。
我可以做什么来添加 my_lib 中的依赖项?或者其他解决方案?
I need to create an original .so library (C code) that uses another .so library. After creating my .so library I wrote a short test program code on C that invokes functions of my lib. It works, but when I compile this program I use that command:
gcc my_test.c -lm -o my_test_program -lmy_lib -lother_lib -L
I need to use my library in Java code (JNA) but when I try to invoke functions from my lib I get this error:
/usr/lib64/libmy_lib.so.0: undefined symbol
I think that means it has lost dependence of other_lib.
What can I do to add dependence in my_lib? Or other solutions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论