未找到Apple Match-O链接器错误库Xcode 6.4

时间:2015-09-27 02:43:11

标签: ios xcode xcode6

我正在尝试测试我的应用程序,并且我在配置上将'Debug'复制到'Debug_Test'以更改环境。我用宏来改变源代码。

我已将预处理器宏添加到'Debug_test',并将'Run'和'Test'架构更改为'Debug_Test'。 我测试了它,但是我得到了下面提到的错误。

Ld /Users/Kuma/Library/Developer/Xcode/DerivedData/TestClient-arjbprptvrrztsesaxtkhhsypwyc/Build/Products/Debug_Test-iphonesimulator/ShareEx.appex/ShareEx normal x86_64
cd /Users/Kuma/Desktop/Test/TestClient
export IPHONEOS_DEPLOYMENT_TARGET=8.4
export 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 x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.4.sdk -L/Users/Kuma/Library/Developer/Xcode/DerivedData/TestClient-arjbprptvrrztsesaxtkhhsypwyc/Build/Products/Debug_Test-iphonesimulator -F/Users/Kuma/Library/Developer/Xcode/DerivedData/TestClient-arjbprptvrrztsesaxtkhhsypwyc/Build/Products/Debug_Test-iphonesimulator -filelist /Users/Kuma/Library/Developer/Xcode/DerivedData/TestClient-arjbprptvrrztsesaxtkhhsypwyc/Build/Intermediates/TestClient.build/Debug_Test-iphonesimulator/ShareEx.build/Objects-normal/x86_64/ShareEx.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @executable_path/../../Frameworks -Xlinker -objc_abi_version -Xlinker 2 -ObjC -lAFNetworking -framework CoreGraphics -framework MobileCoreServices -framework Security -framework SystemConfiguration /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.4.sdk/System/Library/PrivateFrameworks/PlugInKit.framework/PlugInKit -e _NSExtensionMain -fobjc-arc -fobjc-link-runtime -fapplication-extension -Xlinker -no_implicit_dylibs -mios-simulator-version-min=8.4 -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/Kuma/Library/Developer/Xcode/DerivedData/TestClient-arjbprptvrrztsesaxtkhhsypwyc/Build/Intermediates/TestClient.build/Debug_Test-iphonesimulator/ShareEx.build/ShareEx.appex.xcent -framework ShareExtensionEmbedded -lPods-ShareEx -Xlinker -dependency_info -Xlinker /Users/Kuma/Library/Developer/Xcode/DerivedData/TestClient-arjbprptvrrztsesaxtkhhsypwyc/Build/Intermediates/TestClient.build/Debug_Test-iphonesimulator/ShareEx.build/Objects-normal/x86_64/ShareEx_dependency_info.dat -o /Users/Kuma/Library/Developer/Xcode/DerivedData/TestClient-arjbprptvrrztsesaxtkhhsypwyc/Build/Products/Debug_Test-iphonesimulator/ShareEx.appex/ShareEx

ld: library not found for -lAFNetworking
clang: error: linker command failed with exit code 1 (use -v to see invocation)

当然,在更改模式之前,我可以构建并将AFNetworking添加到AppExtension。
我认为需要其他设置。但是,我是初学者,不知道设置。

如果有人知道解决方案,请告诉我。

2 个答案:

答案 0 :(得分:1)

首先,请确保在目标的AFNetworking标签中添加Build Phase库。如果它已经存在,请删除并重新添加。

enter image description here

第二次,确保您的Library Search Path设置正确:

enter image description here

答案 1 :(得分:0)

我能够使用以下代码解决同样的问题。

将其添加到构建设置中的库搜索路径,并确保选择递归,删除可能是绝对路径的其他库路径。

$(PROJECT_DIR) 

可能会帮助你。