Error:linker command failed with exit code 1 (use -v to see invocation) - iOS

今天在操作 CoreData 时,创建完 Create NSManagedObject Subclass...  后,工程中会自动生成四个文件,如下图所示:

此时此刻便以工程,激动人心的时刻来临了!莫名其妙的就抛出了一个异常(linker command failed with exit code 1 (use -v to see invocation)),如下图所示:

解决办法:

起初以为是文件重复导致的,但是距本次抛出异常操作前,只针对 CoreData 进行了操作后来经过仔细排查,所以还是果断将问题定向至了 CoreData 上,并非常肯定以及确认是 CoreData 导致的,因为Xcode 8 会默认生成 SubClass, 通过手动创建 SubClass 会导致文件重复而导致编译报错,所以经过一番排查发现有两处需要在初次使用 CoreData 时进行配置调整即可;

步骤一:

将 Tools Version => Minimum 中的默认参数变更为 7.3,如下图所示:

步骤二:

将 Class => Codegen 中默认选项变更为 Manual/None, 如下图所示:

经过如上两个步骤的操作后,重新 Create NSManagedObject Subclass... 一下,再次编译工程即可.



此次分享到此结束,希望内容能对大家实际有所帮助,有什么不足之处欢迎指点共同进步!

原文地址:https://www.cnblogs.com/survivorsfyh/p/8406482.html

时间: 2024-12-30 00:49:32

Error:linker command failed with exit code 1 (use -v to see invocation) - iOS的相关文章

error: linker command failed with exit code 1 (use -v to see invocation)

; color:rgb(54,46,43); font-family:Arial,Console,Verdana,'Courier New'"> 像这样的一大堆,总体说编译链接时错误 /Users/zhangtianjian/Library/Developer/Xcode/DerivedData/ClothingOrders-bcmqkcjsfgyibbgetgiyczzqcerj/Build/Products/Debug-iphonesimulator/ClothingOrders.ap

(转) error: linker command failed with exit code 1 (use -v to see invocation)

转自:http://blog.csdn.net/tiantian1980/article/details/9175777 像这样的一大堆,总体说编译链接时错误 /Users/zhangtianjian/Library/Developer/Xcode/DerivedData/ClothingOrders-bcmqkcjsfgyibbgetgiyczzqcerj/Build/Products/Debug-iphonesimulator/ClothingOrders.app/ClothingOrder

使用SVN clang: error: linker command failed with exit code 1 (use -v to see invocation)

再把项目上传到SVN仓库上,然后再拉到本地编译时出现如下错误 ld: library not found for -lxxxxxxxxxxxx clang: error: linker command failed with exit code 1 (use -v to see invocation) 原因: SVN在上传资源服务器时默认配置会把一些第三方的.a库文件等给忽略了,然后就造成这样的错误. 解决办法: 配置global-ignores文件 因为我用的是Cornerstone图像工具,

xcode上编译c语言程序报错:ld: x duplicate symbol for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

在网上查了一下: duplicate symbol的大概意思是,编译器认为你重复定义了一些东西. linker command failed with exit code 1,则可能是项目引入了多个相同的文件. 结合本人开发中发现此类的问题,解决办法如下: 方法1:查看有问题的文件是否有重复引用.或头文件是否加载了.m 方法2:将有问题的文件删除,重新加载进去.然后:clean->build. 在开发中解决RegexKitlLite的类似问题办法: _rkl_NSExceptionForRege

nodejs错误:ld: library not found for -lgcc_s.10.5 clang: error: linker command failed with exit code 1 (use -v to see invocation)

解决方案: $ cd /usr/local/lib $ sudo ln -s ../../lib/libSystem.B.dylib libgcc_s.10.5.dylib 参考链接

clang: error: linker command failed with exit code 1 (use -v to see invocation)

报错提示: ... ld: 6 duplicate symbols for architecture x86_64 自己错的原因: 在 .m文件中引入了其他 .m 文件,改成引入 .h 文件即可

Xcode真机报错clang: error: linker command failed with exit code 1 (use -v to see invocation)

出现这种错误,如下图所示,搜索bitcode,置为NO即可.

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

当用第三方库管理工具遇到这样的bug时,请确保Set Build Active Architectures Only在cocoapods和项目中设置为一样的. Had this problem as well. Something was wrong with my CocoaPods installation; No pods other than KIF were installing properly. I followed the comments on this thread to b

IOS Bugs5 linker command failed with exit code 1 (use -v to see invocation)

Ld /Users/Rubert/Library/Developer/Xcode/DerivedData/OC_Language-emftyzftyvhdpuaxipddjmpnpvox/Build/Products/Debug/OC_Language normal x86_64 cd /Users/Rubert/IOS/iworkspace/OC_Language export MACOSX_DEPLOYMENT_TARGET=10.10 /Applications/Xcode-beta.ap