gpt4 book ai didi

objective-c - XCode编译IOS App报错 "file not found: -fobjc-arc"

转载 作者:太空狗 更新时间:2023-10-30 03:36:44 25 4
gpt4 key购买 nike

添加 OCMock 框架后我得到了那个奇怪的错误...:(

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

看起来编译器标志是否试图由 XCode 加载?

有什么想法吗?

最好的问候,希约兰

最佳答案

我在 Xcode 4.3.2 上遇到了完全相同的错误。这是我的导航日志;我将其添加到 Google juice 中。

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 需要一个值——参见 the answer to this question这解释了 -all_load 是您不想指定库名称时使用的内容。

作为一个只花了 25 分钟的人,我应该再次检查 OCMock 教程——我认为该说明中的内容不是很清楚。

This blog post有一个更好的图像,可以准确显示您的设置的外观。

关于objective-c - XCode编译IOS App报错 "file not found: -fobjc-arc",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10529691/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com