在 Mac OS X 10.6 上从 x86_64 .a 文件创建 jnilib

发布于 2024-08-10 06:59:41 字数 280 浏览 2 评论 0原文

我想在 Java 应用程序中使用一堆非通用(薄?)、x86_64、C 库。 问题是我只有它们的静态版本(.a 文件),而 jvm 需要它们是动态的。

我尝试使用 libtool 将这些文件组合成一个动态库,但我刚刚收到错误消息,指出 x86_64 缺少许多符号(可能是全部,有很多),这很奇怪,因为我制作一个小 C 没有问题使用一些库的 -arch x86_64 的应用程序并使其正确链接和运行。

这应该是一个简单的命令行事情吧?我最不想做的就是为已经存在的函数编写自己的包装函数,这样我就可以将它们放入动态库中。

I want to use a bunch of non-universal (thin?), x86_64, C libraries from a Java application.
The problem is that I only have static versions of them (.a files) and the jvm needs them to be dynamic.

I tried using libtool to combine the files into a single dynamic library but I just got error messages saying that many of the symbols (possibly all, there are many) are missing for x86_64, which is strange because I have no problems making a small C application with -arch x86_64 using some of the libraries and get it to link and run correctly.

This should be a simple command line thing right? The last thing I want is to write my own wrapper functions for already existing functions just so I can get them into a dynamic library.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

内心激荡 2024-08-17 06:59:41

我弄清楚了如何修改相关库的构建脚本,以便除了静态库之外还为我制作 dylib,因此这不再是问题。

I figured out how to modify the build scripts for the libs in question to make dylibs for me in addition to the static libs so it's not an issue any more.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文