2012-12-29 63 views
-1

我有一個源代碼庫,它建立在一個靜態庫,但我需要.dylib。所以,我選擇在「生成設置」的Mach-O-Type爲「動態庫」,但得到的錯誤:如何在XCode中構建dylib?

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static -arch_only x86_64 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -L/Users/abc/Library/Developer/Xcode/DerivedData/mylib-fwducbhnvcuzuzaopjfimtlylztm/Build/Products/Debug -filelist /Users/abc/Library/Developer/Xcode/DerivedData/mylib-fwducbhnvcuzuzaopjfimtlylztm/Build/Intermediates/mylib.build/Debug/mylib-osx.build/Objects-normal/x86_64/mylib-osx.LinkFileList -fobjc-link-runtime -framework Foundation -o /Users/abc/Library/Developer/Xcode/DerivedData/mylib-fwducbhnvcuzuzaopjfimtlylztm/Build/Products/Debug/libmylib-osx.a

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: unknown option character `f' in: -fobjc-link-runtime

的libtool出於某種原因使用「-static」,而不是「-dynamic」標誌...兼容性我設定的版本。你認爲什麼可能是錯的?

回答

0

可以從檔案文件(.a)中提取目標文件(.o),然後使用libtool或gcc打包到.dylib中。