对核心数据模型进行微小更改后出现链接器错误
Linker error after making minor change to Core Data model
我正在开始一个新项目,在我通过 CocoaPods 添加 MagicalRecord 后构建良好(我第一次使用 CocoaPods)。
在构建我的数据模型后,我收到一条错误消息,告诉我我没有包含两个实体之间的预期反向关系。我进入数据模型并更正了这个,现在我在重建时收到这个错误:
Ld /Users/myName/Library/Developer/Xcode/DerivedData/ProjectName-ewvswzrvrwxktphioghlirgkuyju/Build/Products/Debug-iphonesimulator/ProjectName.app/ProjectName normal x86_64
cd "/Users/myName/Desktop/Everything from DT 1:20:15/App projects/WMMG/ProjectName"
export IPHONEOS_DEPLOYMENT_TARGET=8.1
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.1.sdk -L/Users/myName/Library/Developer/Xcode/DerivedData/ProjectName-ewvswzrvrwxktphioghlirgkuyju/Build/Products/Debug-iphonesimulator -F/Users/myName/Library/Developer/Xcode/DerivedData/ProjectName-ewvswzrvrwxktphioghlirgkuyju/Build/Products/Debug-iphonesimulator -filelist /Users/myName/Library/Developer/Xcode/DerivedData/ProjectName-ewvswzrvrwxktphioghlirgkuyju/Build/Intermediates/ProjectName.build/Debug-iphonesimulator/ProjectName.build/Objects-normal/x86_64/ProjectName.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -objc_abi_version -Xlinker 2 -ObjC -lPods-MagicalRecord -framework CoreData -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=8.1 -lPods -Xlinker -dependency_info -Xlinker /Users/myName/Library/Developer/Xcode/DerivedData/ProjectName-ewvswzrvrwxktphioghlirgkuyju/Build/Intermediates/ProjectName.build/Debug-iphonesimulator/ProjectName.build/Objects-normal/x86_64/ProjectName_dependency_info.dat -o /Users/myName/Library/Developer/Xcode/DerivedData/ProjectName-ewvswzrvrwxktphioghlirgkuyju/Build/Products/Debug-iphonesimulator/ProjectName.app/ProjectName
ld: library not found for -lPods-MagicalRecord
clang: error: linker command failed with exit code 1 (use -v to see invocation)
该错误似乎明确指出了链接器和 pods 的问题。问题是我没有调试链接器问题的经验,当我发现类似问题的参考文献开始谈论 "dependencies" 等时,我感到非常困惑。很明显找不到 MagicalRecord 库,但我不知道我所做的更改是如何导致问题的,更不确定如何纠正它。
有人可以帮忙吗?
Core Data 会触发这个,这很奇怪。要修复 link 问题,请尝试键入 pod install
(首先 cd 到包含项目工作区的文件夹)。
我正在开始一个新项目,在我通过 CocoaPods 添加 MagicalRecord 后构建良好(我第一次使用 CocoaPods)。
在构建我的数据模型后,我收到一条错误消息,告诉我我没有包含两个实体之间的预期反向关系。我进入数据模型并更正了这个,现在我在重建时收到这个错误:
Ld /Users/myName/Library/Developer/Xcode/DerivedData/ProjectName-ewvswzrvrwxktphioghlirgkuyju/Build/Products/Debug-iphonesimulator/ProjectName.app/ProjectName normal x86_64
cd "/Users/myName/Desktop/Everything from DT 1:20:15/App projects/WMMG/ProjectName"
export IPHONEOS_DEPLOYMENT_TARGET=8.1
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.1.sdk -L/Users/myName/Library/Developer/Xcode/DerivedData/ProjectName-ewvswzrvrwxktphioghlirgkuyju/Build/Products/Debug-iphonesimulator -F/Users/myName/Library/Developer/Xcode/DerivedData/ProjectName-ewvswzrvrwxktphioghlirgkuyju/Build/Products/Debug-iphonesimulator -filelist /Users/myName/Library/Developer/Xcode/DerivedData/ProjectName-ewvswzrvrwxktphioghlirgkuyju/Build/Intermediates/ProjectName.build/Debug-iphonesimulator/ProjectName.build/Objects-normal/x86_64/ProjectName.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -objc_abi_version -Xlinker 2 -ObjC -lPods-MagicalRecord -framework CoreData -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=8.1 -lPods -Xlinker -dependency_info -Xlinker /Users/myName/Library/Developer/Xcode/DerivedData/ProjectName-ewvswzrvrwxktphioghlirgkuyju/Build/Intermediates/ProjectName.build/Debug-iphonesimulator/ProjectName.build/Objects-normal/x86_64/ProjectName_dependency_info.dat -o /Users/myName/Library/Developer/Xcode/DerivedData/ProjectName-ewvswzrvrwxktphioghlirgkuyju/Build/Products/Debug-iphonesimulator/ProjectName.app/ProjectName
ld: library not found for -lPods-MagicalRecord
clang: error: linker command failed with exit code 1 (use -v to see invocation)
该错误似乎明确指出了链接器和 pods 的问题。问题是我没有调试链接器问题的经验,当我发现类似问题的参考文献开始谈论 "dependencies" 等时,我感到非常困惑。很明显找不到 MagicalRecord 库,但我不知道我所做的更改是如何导致问题的,更不确定如何纠正它。
有人可以帮忙吗?
Core Data 会触发这个,这很奇怪。要修复 link 问题,请尝试键入 pod install
(首先 cd 到包含项目工作区的文件夹)。