Undefined symbols for architecture x86_64:

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_WJWModel", referenced from:
      objc-class-ref in VisitorSelectValidDatePopVC.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

最近发现一个低级错误,在Model1.h中定义2个接口 @interface

@interface Model1


@end


@interface Model2


@end

没有在Model1.m中实现

@implemention Model1

@end

//少了这个
@implemention Model2

@end

在.h中定义了一个用来声明对象的接口,在.m中要把实现部分写上,不然就会报如上错误。

一般我们定义一个类,会在obj.h,  obj.m中分别自动生成

@interface obj:NSObject

@end

@implemention

@end

但是临时新增的 @interface有时候忘了了在.m中添加上 @implemention会报错。

 还有些时候忘了导入引入的framwork,也会出现这个类似的错误。

https://stackoverflow.com/questions/31982865/undefined-symbols-for-architecture-x86-64-objc-class-cmmotionmanager-refe

猜你喜欢

转载自www.cnblogs.com/wjw-blog/p/9173471.html