先贴一下错误:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_Test", referenced from:
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
1、新建工程引入Test这个类,首先targets不勾选
然后在viewController里面创建这个Test对象
此时编译就会报这个错误
解决:
因为在编译过程中,compile sources不存在这个类,所以会报错,
此时再次编译一下OK