作者:萝莉控的许123321 | 来源:互联网 | 2023-07-15 12:53
错误日志Undefinedsymbolsforarchitecturearm64:"vtablefor__cxxabiv1::__si_class_type_info&quo
错误日志
Undefined symbols for architecture arm64:
"vtable for __cxxabiv1::__si_class_type_info", referenced from:
typeinfo for Kernel in libTalkingData.a(svm.o)
typeinfo for Solver_NU in libTalkingData.a(svm.o)
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"___cxa_pure_virtual", referenced from:
vtable for Kernel in libTalkingData.a(svm.o)
"vtable for __cxxabiv1::__class_type_info", referenced from:
typeinfo for QMatrix in libTalkingData.a(svm.o)
typeinfo for Solver in libTalkingData.a(svm.o)
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"operator delete(void*)", referenced from:
Kernel::~Kernel() in libTalkingData.a(svm.o)
Solver::~Solver() in libTalkingData.a(svm.o)
Solver_NU::~Solver_NU() in libTalkingData.a(svm.o)
"operator delete[](void*)", referenced from:
Kernel::~Kernel() in libTalkingData.a(svm.o)
Solver::Solve(int, QMatrix const&, double const*, signed char const*, double*, double, double, double, Solver::SolutionInfo*, int) in libTalkingData.a(svm.o)
"operator new[](unsigned long)", referenced from:
Kernel::Kernel(int, svm_node* const*, svm_parameter const&) in libTalkingData.a(svm.o)
Solver::Solve(int, QMatrix const&, double const*, signed char const*, double*, double, double, double, Solver::SolutionInfo*, int) in libTalkingData.a(svm.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
解决方案:
静态库中采用ObjectC++实现,遇到这样的问题看看是不是配置不对,需要保证工程中至少有一个.mm后缀的源文件,或在工程属性中指定编译方式。修改方式如下:
1 可以将任意一个.m后缀的文件改名为.mm
2 在Xcode的 Target -> Build Settings -> Apple LLVM 8.0 - Language -> Compile Sources As修改为"Objective-C++