使用多个框架会产生clang:error:linker命令失败,退出代码为1
Using multiple frameworks gives clang: error: linker command failed with exit code 1
就像我说的。。我使用两个框架,FlashIz和MWPhotoBrowser。(事实上,我使用了更多,但他们不会给出错误。)
在构建项目时,我遇到了这样的错误:
Ld /Users/Korneel/Library/Developer/Xcode/DerivedData/gTicket-grnuygifaetsfmbdncixojogumle/Build/Products/Debug-iphoneos/gTicket.app/gTicket normal armv7
cd /Users/Korneel/Documents/stage-genius/trunk/IOS/gTicket
export IPHONEOS_DEPLOYMENT_TARGET=6.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/clang -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk -L/Users/Korneel/Library/Developer/Xcode/DerivedData/gTicket-grnuygifaetsfmbdncixojogumle/Build/Products/Debug-iphoneos -F/Users/Korneel/Library/Developer/Xcode/DerivedData/gTicket-grnuygifaetsfmbdncixojogumle/Build/Products/Debug-iphoneos -F/Users/Korneel/Documents/stage-genius/trunk/IOS/gTicket/FlashizEmbeddedLibrary.embeddedframwork -filelist /Users/Korneel/Library/Developer/Xcode/DerivedData/gTicket-grnuygifaetsfmbdncixojogumle/Build/Intermediates/gTicket.build/Debug-iphoneos/gTicket.build/Objects-normal/armv7/gTicket.LinkFileList -dead_strip -all_load -ObjC -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=6.0 /Users/Korneel/Library/Developer/Xcode/DerivedData/gTicket-grnuygifaetsfmbdncixojogumle/Build/Products/Debug-iphoneos/libMWPhotoBrowser.a -framework MapKit -framework AssetsLibrary -framework MessageUI -framework FlashizEmbeddedLibrary -framework ImageIO -framework SystemConfiguration -framework QuartzCore /Users/Korneel/Library/Developer/Xcode/DerivedData/gTicket-grnuygifaetsfmbdncixojogumle/Build/Products/Debug-iphoneos/libTapkuLibrary.a -framework CoreGraphics -framework UIKit -framework Foundation -Xlinker -dependency_info -Xlinker /Users/Korneel/Library/Developer/Xcode/DerivedData/gTicket-grnuygifaetsfmbdncixojogumle/Build/Intermediates/gTicket.build/Debug-iphoneos/gTicket.build/Objects-normal/armv7/gTicket_dependency_info.dat -o /Users/Korneel/Library/Developer/Xcode/DerivedData/gTicket-grnuygifaetsfmbdncixojogumle/Build/Products/Debug-iphoneos/gTicket.app/gTicket
duplicate symbol _OBJC_IVAR_$_MBProgressHUD.mode in:
/Users/Korneel/Library/Developer/Xcode/DerivedData/gTicket-grnuygifaetsfmbdncixojogumle/Build/Products/Debug-iphoneos/libMWPhotoBrowser.a(MBProgressHUD.o)
/Users/Korneel/Documents/stage-genius/trunk/IOS/gTicket/FlashizEmbeddedLibrary.embeddedframwork/FlashizEmbeddedLibrary.framework/FlashizEmbeddedLibrary(MBProgressHUD.o)
ld: 29 duplicate symbols for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
因此,我从这个错误中推断出,这两个框架使用的是相同的"框架",如MBProgressHUD。所以我想去掉其中的一个?但我不知道怎么。。有没有人遇到过类似的问题?问题是,我似乎找不到这些文件?
这里的问题是重复。MBProgressHUD
添加了两次(来自libMWPhotoBrowser.a
和FlashizEmbeddedLibrary
)
因此,从任何一个libs中删除。
这表明它是由于重复的符号造成的。在您的项目中有多个类别的MBProgressHUD
。请只使用一个类并删除另一个类。这将解决您的问题,
相关文章:
- Netbeans 10:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)
- 链接器命令失败,macOS 上的退出代码为 1(使用 -v 查看调用)
- CMake 错误:链接器命令失败,退出代码为 1 和 cpp.o 文件
- clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用) - 体系结构的未定义符号 x86_64:
- 如何修复 clang: 错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)
- 当命令失败时,gzip 会在 C++ 中返回错误代码吗?
- Xcode:链接器命令失败,退出代码为 1(使用 -v 查看调用)[C++]
- 电报上的构建命令失败
- Android NDK.Build命令失败.未定义的引用.clang++:错误:链接器命令失败,退出代码为1
- exteranl原生构建问题,构建命令失败,android工作室
- build命令失败,外部原生问题android工作室
- 错误:链接器命令失败,退出代码为 1(使用 -v 查看调用):在 Macbook 上
- make:致命错误:目标命令失败
- C++ XCODE ld:找不到体系结构x86_64 clang 的符号:错误:链接器命令失败,退出代码为 1(使用 -
- Android Studio 链接器命令在包含 Boost 库时失败
- Android opencv 3.4.1 Build 命令失败.未定义的引用
- clang:错误:链接器命令失败,C++代码中的退出代码为 1(使用 -v 查看调用)
- mkdir 从命令行工作,但在使用 NFS 时C++失败
- Xcode 10.0:链接器命令失败,退出代码为 1(使用 -v 查看调用)
- C++使用命令行输入 txt 文件,但打开文件失败