连接Xcode 6 / LLVM 6的选择性库

时间:2022-09-18 12:26:01

I selectively link a library depending on the configuration in my project build settings. i.e.

我根据项目构建设置中的配置有选择地链接库。即

Debug: -l libcws_ps Release: -l libcws

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

In library search paths, I point to the directory that contains these 2 .a libraries.

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

I'll point out that this worked on Xcode 5, but now on Xcode 6 it's not linking properly and I'm getting undefined symbol errors. If I link using the usual method - 'link binary with libraries', then it works - but then I don't have the configuration based linking.

我会指出这适用于Xcode 5,但现在在Xcode 6上,它没有正确链接,我得到了未定义的符号错误。如果我使用通常的方法链接 - '链接二进制文件',那么它可以工作 - 但是我没有基于配置的链接。

Any ideas how to fix this, or at least some clues how I get debug it?

任何想法如何解决这个问题,或者至少是一些线索我如何调试呢?

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

1 个解决方案

#1


6  

RTFM... or RTFRN... Xcode 6 release notes

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

"Xcode will no longer pass options in the build setting OTHER_LDFLAGS to libtool when building static libraries, nor will it pass options in OTHER_LIBTOOLFLAGS to the Mach-O linker when building any other kind of product. Previously all options in both settings would be passed to both tools. Make sure that options are in the correct build setting for the product type, static library, or other component being built. (4285249)"

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

So it just wasn't even passing my 'other linker flags'. I needed to move them to 'other librarian flags'.

所以它甚至没有通过我的'其他链接器标志'。我需要将它们移到“其他图书馆员旗帜”。

#1


6  

RTFM... or RTFRN... Xcode 6 release notes

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

"Xcode will no longer pass options in the build setting OTHER_LDFLAGS to libtool when building static libraries, nor will it pass options in OTHER_LIBTOOLFLAGS to the Mach-O linker when building any other kind of product. Previously all options in both settings would be passed to both tools. Make sure that options are in the correct build setting for the product type, static library, or other component being built. (4285249)"

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

So it just wasn't even passing my 'other linker flags'. I needed to move them to 'other librarian flags'.

所以它甚至没有通过我的'其他链接器标志'。我需要将它们移到“其他图书馆员旗帜”。