简体   繁体   English

使用多个框架会产生clang:错误:链接器命令失败,退出代码为1

[英]Using multiple frameworks gives clang: error: linker command failed with exit code 1

Like I'm saying.. I'm using two frameworks, FlashIz and MWPhotoBrowser. 就像我说的..我正在使用两个框架,FlashIz和MWPhotoBrowser。 (Actually I'm using more, but they don't give errors..) (实际上,我使用的更多,但它们不会出错。)

When building the project, I got errors like this: 在构建项目时,出现如下错误:

    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)

So, I derived from this error that those two frameworks are using the same 'frameworks' like MBProgressHUD. 因此,我从这个错误中得出了那两个框架正在使用相同的“框架”(例如MBProgressHUD)的信息。 So I thought of removing 1 of those? 所以我想删除其中之一? But I don't know how.. Is there anyone who had a similar problem? 但是我不知道怎么办。有人吗? The problem is, I can't seem to find this files? 问题是,我似乎找不到此文件?

Problem here is duplication . 这里的问题是重复 MBProgressHUD have added twice(from libMWPhotoBrowser.a and FlashizEmbeddedLibrary ) MBProgressHUD已添加两次(来自libMWPhotoBrowser.aFlashizEmbeddedLibrary

So Remove from any one of those libs. 因此,从任何一个库中删除。

It is showing that it was due to duplicate symbol. 它表明这是由于重复的符号。 In your project there are multiple classes of MBProgressHUD . 在您的项目中,有MBProgressHUD多个类。 Please use only one class and remove other. 请仅使用一个类,并删除其他类。 This will resolve your problem, 这样可以解决您的问题,

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 链接器命令失败,退出代码1 clang:错误 - linker command failed with exit code 1 clang:error clang++:错误:链接器命令失败,退出代码为 1 Qt Android - clang++: error: linker command failed with exit code 1 Qt Android Visual Studio Code clang 错误:linker 命令在 Mac 上失败,退出代码为 1 - Visual Studio Code clang error: linker command failed with exit code 1 on Mac 启用 OpenMP 的简单代码无法编译:“clang: 错误:链接器命令失败,退出代码为 1” - Simple OpenMP-enabled code does not compile: "clang: error: linker command failed with exit code 1" clang:错误:在cmake中链接库时,链接器命令失败,退出代码为1(使用-v查看调用) - clang: error: linker command failed with exit code 1 (use -v to see invocation) when linking library in cmake 铛:错误:链接器命令失败,退出代码为1(使用-v查看调用)*关于全局变量 - clang: error: linker command failed with exit code 1 (use -v to see invocation) *about global variables VSCode:clang:错误:linker 命令失败,退出代码为 1(使用 -v 查看调用) - VSCode: clang: error: linker command failed with exit code 1 (use -v to see invocation) 编译我的 C++ 程序:clang: error: linker command failed with exit code 1(使用 -v 查看调用) - Compiling my c++ program: clang: error: linker command failed with exit code 1 (use -v to see invocation) Cocos2d-x-铛:错误:链接器命令失败,退出代码为1(使用-v查看调用) - Cocos2d-x - clang: error: linker command failed with exit code 1 (use -v to see invocation) clang++:错误:linker 命令在带有 ffmpeg 的 cpp 中失败,退出代码为 1(使用 -v 查看调用) - clang++: error: linker command failed with exit code 1 (use -v to see invocation) in cpp with ffmpeg
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM