Undefined symbols for architecture x86_64: ( linker command failed with exit code 1)

时间:2021-09-01 23:03:53

当出现  linker command failed with exit code 1 (use -v to see invocation) 的错误总结,具体内容如下:
Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_AppDelegate", referenced from:
      objc-class-ref in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Undefined symbols for architecture x86_64: ( linker command failed with exit code 1)
 
解决方法:
找到你的工程,BuildPhases,Compile Source,然后看上图中提示找不到那个类名,此处是 
AppDelegate,所以在Compile Source一栏里点击左下角的“+”号,手动添加AppDelegate.m,再次运行程序,完美解决!
Undefined symbols for architecture x86_64: ( linker command failed with exit code 1)
 
 
至于出现 Undefined symbols for architecture armv7: 这样的出错提示,可以参考这个链接解决http://blog.csdn.net/hengshujiyi/article/details/21182813