Mac OS X libcurl dylib 兼容版本
我的应用程序在 10.6 上构建并运行良好。我将 Base SDK 设置为 10.6,将 Mac OS X 部署目标设置为 10.5。
我的应用程序使用系统 libcurl.dylib — 我没有将 dylib 添加到项目中,而是将 -lcurl
添加到构建设置中的链接器标志中。 (虽然我已经尝试过两种方法。)
当我在 10.5.8 上启动应用程序时,出现以下错误
Dyld 错误消息:未加载库:/usr/lib/libcurl.4.dylib
引用自:/Applications/My Application.app/Contents/MacOS/MyApplication
原因:库版本不兼容:
MyApplication 需要版本 6.0.0 或 稍后,但 libcurl.4.dylib 提供 版本5.0.0
果然,如果我 otool -L
应用程序的二进制文件,我会得到以下 libcurl 信息:
/usr/lib/libcurl.4.dylib(兼容版本6.0.0,当前版本6.1.0)
有什么办法可以解决这个问题,或者我应该静态链接我自己的 libcurl 版本?
My application builds and runs fine on 10.6. I have Base SDK set to 10.6 and Mac OS X Deployment Target set to 10.5.
My application uses the system libcurl.dylib — instead of adding the dylib to the project, I just add -lcurl
to the linker flags in build settings. (Though I have tried it both ways.)
When I launch the application on 10.5.8, I get the following error
Dyld Error Message: Library not loaded: /usr/lib/libcurl.4.dylib
Referenced from: /Applications/My Application.app/Contents/MacOS/MyApplication
Reason: Incompatible library version:
MyApplication requires version 6.0.0 or
later, but libcurl.4.dylib provides
version 5.0.0
Sure enough, if I otool -L
the application's binary, I get the following for libcurl:
/usr/lib/libcurl.4.dylib (compatibility version 6.0.0, current version 6.1.0)
Is there any way around this, or should I just statically link my own libcurl build?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否也尝试过将 Base SDK 设置为 10.5?
Have you tried setting the Base SDK to 10.5 as well?