iOS 报错 Undefined symbols for architecture x86_64:解决方法

     联系人:石虎 QQ:1224614774  昵称: 嗡嘛呢叭咪哄

                             QQ群:807236138  群称: iOS 技术交流学习群

                            QQ群:713799633   群称:iOS技术交流学习群-2

一、报错详情

 

Undefined symbols for architecture x86_64:

"_OBJC_CLASS_$_Person", referenced from:

_OBJC_CLASS_$_Dog in Dog.o

objc-class-ref in ViewController.o

"_OBJC_METACLASS_$_Person", referenced from:

_OBJC_METACLASS_$_Dog in Dog.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:

2:在 build Phases 下操作如下

3:添加类文件

 

4:编译成功

 

 

 

三、造成 bug 原因,以及如何避免

 

1.造成 bug 原因是其它类没有参加编译造成的,这种原因又分成二种

 

2.如何避免

第一种:此框一定要勾选

 

第二种:此框一定要勾选

 

注意:如果忘记勾选,就在项目中的 Build Phases 中的 Compile Sources 中添加(详细前看图4)

 

谢谢!!!

本账号主要分享我成长过程中的各种心得感悟,包括技术总结, iOS、Swift 和 Mac 相关技术文章、工具资源、参与技术讨论,整理开发技巧、让学习成为一种享受!

Ld /Users/qingguo/Library/Developer/Xcode/DerivedData/APP_FFT_Framework-fjxfxozmofjhqzbflrggfayhgspf/Build/Products/Debug-iphoneos/APP_FFT_Framework.framework/APP_FFT_Framework normal (in target 'APP_FFT_Framework' from project 'APP_FFT_Framework') cd /Users/qingguo/Desktop/nounou/yes/QGtest/APP_FFT_Framework /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -Xlinker -reproducible -target arm64-apple-ios18.2 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.2.sdk -O0 -L/Users/qingguo/Library/Developer/Xcode/DerivedData/APP_FFT_Framework-fjxfxozmofjhqzbflrggfayhgspf/Build/Intermediates.noindex/EagerLinkingTBDs/Debug-iphoneos -L/Users/qingguo/Library/Developer/Xcode/DerivedData/APP_FFT_Framework-fjxfxozmofjhqzbflrggfayhgspf/Build/Products/Debug-iphoneos -L/opt/homebrew/lib -F/Users/qingguo/Library/Developer/Xcode/DerivedData/APP_FFT_Framework-fjxfxozmofjhqzbflrggfayhgspf/Build/Intermediates.noindex/EagerLinkingTBDs/Debug-iphoneos -F/Users/qingguo/Library/Developer/Xcode/DerivedData/APP_FFT_Framework-fjxfxozmofjhqzbflrggfayhgspf/Build/Products/Debug-iphoneos -filelist /Users/qingguo/Library/Developer/Xcode/DerivedData/APP_FFT_Framework-fjxfxozmofjhqzbflrggfayhgspf/Build/Intermediates.noindex/APP_FFT_Framework.build/Debug-iphoneos/APP_FFT_Framework.build/Objects-normal/arm64/APP_FFT_Framework.LinkFileList -install_name @rpath/APP_FFT_Framework.framework/APP_FFT_Framework -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/qingguo/Library/Developer/Xcode/DerivedData/APP_FFT_Framework-fjxfxozmofjhqzbflrggfayhgspf/Build/Intermediates.noindex/APP_FFT_Framework.build/Debug-iphoneos/APP_FFT_Framework.build/Objects-normal/arm64/APP_FFT_Framework_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -L/opt/homebrew/lib\ -lgsl\ -lgslcblas -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /Users/qingguo/Library/Developer/Xcode/DerivedData/APP_FFT_Framework-fjxfxozmofjhqzbflrggfayhgspf/Build/Intermediates.noindex/APP_FFT_Framework.build/Debug-iphoneos/APP_FFT_Framework.build/Objects-normal/arm64/APP_FFT_Framework_dependency_info.dat -o /Users/qingguo/Library/Developer/Xcode/DerivedData/APP_FFT_Framework-fjxfxozmofjhqzbflrggfayhgspf/Build/Products/Debug-iphoneos/APP_FFT_Framework.framework/APP_FFT_Framework ld: warning: search path '/opt/homebrew/lib -lgsl -lgslcblas' not found Undefined symbols for architecture arm64: "_gsl_interp_cspline_periodic", referenced from: _test_csplinep in test.o _test_csplinep2 in test.o "_gsl_spline_eval_deriv", referenced from: _bicubic_init in bicubic.o _bicubic_init in bicubic.o _bicubic_init in bicubic.o "_gsl_vector_alloc", referenced from: _bicubic_init in bicubic.o _bicubic_init in bicubic.o _bicubic_init in bicubic.o _bicubic_init in bicubic.o _bicubic_init in bicubic.o _bicubic_init in bicubic.o "_gsl_vector_free", referenced from: _bicubic_init in bicubic.o _bicubic_init in bicubic.o _bicubic_init in bicubic.o _bicubic_init in bicubic.o _bicubic_init in bicubic.o _bicubic_init in bicubic.o "_gsl_vector_set", referenced from: _bicubic_init in bicubic.o _bicubic_init in bicubic.o _bicubic_init in bicubic.o _bicubic_init in bicubic.o _bicubic_init in bicubic.o _bicubic_init in bicubic.o "_gsl_vector_view_array", referenced from: _cspline_init in cspline.o _cspline_init in cspline.o _cspline_init in cspline.o _cspline_init in cspline.o ld: symbol(s) not found for architecture arm64 clang++: error: linker command failed with exit code 1 (use -v to see invocation)
03-21
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值