Mac OS X libcurl dylib compatibility version

送分小仙女□ 提交于 2019-12-06 02:13:29

问题


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?


回答1:


Have you tried setting the Base SDK to 10.5 as well?

$ otool -L /Developer/SDKs/MacOSX10.6.sdk/usr/lib/libcurl.4.dylib
/Developer/SDKs/MacOSX10.6.sdk/usr/lib/libcurl.4.dylib:
    /usr/lib/libcurl.4.dylib (compatibility version 6.0.0, current version 6.1.0)
    ...]
$ otool -L /Developer/SDKs/MacOSX10.5.sdk/usr/lib/libcurl.4.dylib
/Developer/SDKs/MacOSX10.5.sdk/usr/lib/libcurl.4.dylib:
    /usr/lib/libcurl.4.dylib (compatibility version 5.0.0, current version 5.0.0)
    [...]


来源:https://stackoverflow.com/questions/6363993/mac-os-x-libcurl-dylib-compatibility-version

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!