ld: symbol(s) not found for architecture i386 只在iPad模擬器上報錯,其它模擬器上正常顯示
阿新 • • 發佈:2018-12-21
專案中引入別人的.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。
很好的解決了我的問題,非常感謝,特此記錄一下,希望能夠幫助相同問題的人