为 iphone 构建 libsrtp 的正确配置?
我正在尝试构建 libsrtp,以便我可以在 iPhone 上使用它(我打算将它与 libav 的 RTP 实现一起使用)。
我的配置:
./配置 --build='arm-apple-darwin9'
当我尝试调用 srtp_init() 时收到的警告:
文件是为不受支持的文件构建的 格式不是架构 正在链接(armv7)
后出现错误:
“_srtp_init”,引用自:
+[Manager 初始化:] 在 Manager.o
未找到符号
有谁知道正确构建库的正确配置吗?
I'm trying to build libsrtp so that I can use it on the iPhone (I intend to use it with libav's implementation of RTP).
My configuration:
./configure
--build='arm-apple-darwin9'
The warning I get when I attempt to call srtp_init():
file was built for unsupported file
format which is not the architecture
being linked (armv7)
Followed by the error:
"_srtp_init", referenced from:
+[Manager initialize:] in Manager.o
Symbol(s) not found
Does anyone know the proper configuration for building the library correctly?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
问题是它不是为 ARM 构建的(或者不是为正确的 ARM 构建的;您需要查看使用哪些选项调用哪个编译器,并将其与您知道正在运行的编译器进行比较)。你用autoconf重建配置了吗?请参阅 GNU 构建系统 wiki 页面,了解如何为其他系统重新配置构建的起点/处理器。
仅供参考,如果您在 configure.in 或 libsrtp 的其他部分中发现错误,请告诉我 - 我是具有签入权限的作者。
The problem is it's not being built for ARM (or not for the right ARM; you need to look at which compiler is bing invoked with which options, and compare it to one you know is working). Did you do rebuild configure with autoconf? See the GNU build system wiki page for a starting point on how to reconfigure the build for other systems/processors.
FYI, if you find a bug in the configure.in or other parts of libsrtp, please let me know - I'm an author on it with checkin privs.
有关 iOS 交叉编译库的一般指南,我推荐这篇文章:
http://tinsuke. wordpress.com/2011/02/17/how-to-cross-compiling-libraries-for-ios-armv6armv7i386/
同一个人还为 iOS 5 编写了一个更新版本。这个版本特定于
tesseract
库,但总体原理是相同的:http://tinsuke.wordpress.com/2011/11/01/how-to-compile-and-use-tesseract-3-01-on-ios-sdk-5/。
使用这些作为指导,我已经成功编译了一些库。需要注意的关键事项是您必须禁用编译共享二进制文件。我还建议使用
clang
而不是gcc
。For general guidelines on cross compiling libraries for iOS I recommend this article:
http://tinsuke.wordpress.com/2011/02/17/how-to-cross-compiling-libraries-for-ios-armv6armv7i386/
The same guy also wrote an updated version for iOS 5. This one is specific to the
tesseract
library, but the general principles are the same:http://tinsuke.wordpress.com/2011/11/01/how-to-compile-and-use-tesseract-3-01-on-ios-sdk-5/.
Using these as a guide I've had some success compiling a few libraries. Key things to note are that you have to disable compiling shared binaries. Also I recommend using
clang
rather thangcc
.