选择性库链接 Xcode 6 / LLVM 6

3

根据我项目构建设置的配置,我有选择地链接库。例如:

调试:-l libcws_ps 发布:-l libcws

在库搜索路径中,我指向包含这两个 .a 库的目录。

我要指出,这在 Xcode 5 上可以工作,但现在在 Xcode 6 上却无法正确链接,并且会出现未定义符号错误。如果我使用通常的方法进行链接 - “链接二进制文件和库”,那么它就能正常工作 - 但是我就无法根据配置进行链接了。

有什么方法可以修复这个问题,或者至少给我一些线索来调试它吗?

Libtool /Users/dave/Library/Developer/Xcode/DerivedData/FilmFlexMovies-ddwyjuvbhaqgqralpjczhprnltla/Build/Products/Release-iphoneos/libiOSIrdetoLibrary.a normal armv7
cd /Users/dave/Developer/GIT/FilmFlex/iOS/Submodules/iOSModelController/Submodules/iOSIrdetoLibrary
export IPHONEOS_DEPLOYMENT_TARGET=7.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static -arch_only armv7 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk -L/Users/dave/Library/Developer/Xcode/DerivedData/FilmFlexMovies-ddwyjuvbhaqgqralpjczhprnltla/Build/Products/Release-iphoneos -LCloakwareStreaming/lib/ios -L/Users/dave/Developer/GIT/FilmFlex/iOS/Submodules/iOSModelController/Submodules/iOSIrdetoLibrary/CloakwareStreaming/lib/ios -filelist /Users/dave/Library/Developer/Xcode/DerivedData/FilmFlexMovies-ddwyjuvbhaqgqralpjczhprnltla/Build/Intermediates/iOSIrdetoLibrary.build/Release-iphoneos/iOSIrdetoLibrary.build/Objects-normal/armv7/iOSIrdetoLibrary.LinkFileList -framework MediaPlayer -framework CoreVideo -framework AVFoundation -framework UIKit -framework Foundation -o /Users/dave/Library/Developer/Xcode/DerivedData/FilmFlexMovies-ddwyjuvbhaqgqralpjczhprnltla/Build/Products/Release-iphoneos/libiOSIrdetoLibrary.a

嗯,那应该可以。你能否在你的问题中添加Xcode 6在链接期间使用的命令行? - trojanfoe
1个回答

6

RTFM...或者RTFRN...Xcode 6发行说明

"在构建静态库时,Xcode将不再将选项传递到OTHER_LDFLAGS构建设置中的libtool中,也不会将选项传递到Mach-O链接器中OTHER_LIBTOOLFLAGS构建任何其他类型的产品。以前,这两个设置中的所有选项都将传递到这两个工具中。确保选项位于正确的构建设置中,以用于构建类型、静态库或其他组件。(4285249)"

因此,它甚至没有传递我的“其他链接器标志”。我需要将它们移动到“其他图书馆管理员标志”。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接