ld: symbol(s) not found for architecture i386 只在iPad模拟器上报错,其它模拟器上正常显示

项目中引入别人的.a文件,在其它模拟器上都能正常编译,但在ipad的上编译报错。具体报错如下:

Undefined symbols for architecture i386:

  "_clock$UNIX2003", referenced from:

      _DHHEVC_av_get_random_seed in libhevcdec.a(random_seed.o)

  "_fputs$UNIX2003", referenced from:

      _dh_hevc_colored_fputs in libhevcdec.a(log.o)

  "_mktime$UNIX2003", referenced from:

      _DHHEVC_av_parse_time in libhevcdec.a(parseutils.o)

  "_strtod$UNIX2003", referenced from:

      _DHHEVC_av_strtod in libhevcdec.a(eval.o)

      _parse_factor in libhevcdec.a(eval.o)

      _DHHEVC_av_parse_color in libhevcdec.a(parseutils.o)

ld: symbol(s) not found for architecture i386

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

后来查找说缺少.c文件,加入.c文件后,编译都报错,

module 'ObjectiveC.NSObject' requires feature 'objc'

unknown type name 'NSString'

could not build module 'Foundation'

等等错误,看到一博主文章,文章链接https://blog.csdn.net/nigelr/article/details/51378535

使用方案一:

选择所有.c文件,将属性的 identity and type 改为Objective-C Source。

很好的解决了我的问题,非常感谢,特此记录一下,希望能够帮助相同问题的人

猜你喜欢

转载自blog.csdn.net/lyh20133102/article/details/84308698