在Xcode中编译iOS应用:错误“-fobjc弧找不到文件”(Error “file not fo

2019-06-24 07:32发布

加入OCMock框架后,我得到了奇怪的错误... :(

ld: file not found: -fobjc-arc
clang: error: linker command failed with exit code 1 (use -v to see invocation)

看起来,如果编译器标志试图通过XCode中加载什么样的?

任何的想法?

最好的问候,hijolan

Answer 1:

我正上的Xcode 4.3.2完全相同的错误。 这里是我的领航员日志; 我将它谷歌果汁。

Ld /Users/makdad/Library/Developer/Xcode/DerivedData/Journal-bfkvfbsrkmrsjpddzfmwrstjfkzr/Build/Products/Debug-iphonesimulator/JournalTests.octest/JournalTests normal i386
cd /Users/makdad/Documents/MT/mt-mobile/iOS/Journal
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.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 i386 -bundle -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk -L/Users/phooze/Library/Developer/Xcode/DerivedData/Journal-bfkvfbsrkmrsjpddzfmwrstjfkzr/Build/Products/Debug-iphonesimulator -F/Users/phooze/Library/Developer/Xcode/DerivedData/Journal-bfkvfbsrkmrsjpddzfmwrstjfkzr/Build/Products/Debug-iphonesimulator -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -filelist /Users/phooze/Library/Developer/Xcode/DerivedData/Journal-bfkvfbsrkmrsjpddzfmwrstjfkzr/Build/Intermediates/Journal.build/Debug-iphonesimulator/JournalTests.build/Objects-normal/i386/JournalTests.LinkFileList -mmacosx-version-min=10.6 -bundle_loader /Users/phooze/Library/Developer/Xcode/DerivedData/Journal-bfkvfbsrkmrsjpddzfmwrstjfkzr/Build/Products/Debug-iphonesimulator/Journal.app/Journal -Xlinker -objc_abi_version -Xlinker 2 -ObjC -force_load -fobjc-arc -ftest-coverage -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=40100 -lOCMock -framework Twitter -framework MapKit -framework MobileCoreServices -framework SystemConfiguration -lxml2 -licucore -framework CoreData -framework CoreGraphics -framework CFNetwork -framework QuartzCore -framework SenTestingKit -framework UIKit -framework Foundation -o /Users/phooze/Library/Developer/Xcode/DerivedData/Journal-bfkvfbsrkmrsjpddzfmwrstjfkzr/Build/Products/Debug-iphonesimulator/JournalTests.octest/JournalTests

该OCMock指令明确要求你添加连接标志- -ObjC-force_load

-force_load期待值-看到了这个问题的答案是解释-all_load是用什么,如果你不希望指定库名。

正如有人谁只用了25分钟,这一点,我应该用OCMock教程再次检查 - 我不认为这是在该指令非常明确。

这个博客帖子有一个更好的形象,显示您的设置应该究竟如何看。



文章来源: Error “file not found: -fobjc-arc” on compiling IOS App in XCode