我在Xcode 11.1上遇到了这个问题
它将在实际设备上引发此错误。
Undefined symbols for architecture arm64:
"std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&)", referenced from:
std::pair<std::string const, std::pair<unsigned int, unsigned int> >::pair(std::pair<std::string const, std::pair<unsigned int, unsigned int> > const&) in libtms.a(tms.cc.o)
std::pair<std::string const, std::pair<unsigned int, unsigned int> >::pair(std::string const&, std::pair<unsigned int, unsigned int> const&) in libtms.a(tms.cc.o)
"std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)", referenced from:
std::_Rb_tree<std::string, std::pair<std::string const, std::pair<unsigned int, unsigned int> >, std::_Select1st<std::pair<std::string const, std::pair<unsigned int, unsigned int> > >, std::less<std::string>, std::allocator<std::pair<std::string const, std::pair<unsigned int, unsigned int> > > >::_M_insert(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::pair<std::string const, std::pair<unsigned int, unsigned int> > const&) in libtms.a(tms.cc.o)
"std::_Rb_tree_increment(std::_Rb_tree_node_base*)", referenced from:
std::_Rb_tree_iterator<std::pair<std::string const, std::pair<unsigned int, unsigned int> > >::operator++() in libtms.a(tms.cc.o)
"std::string::compare(std::string const&) const", referenced from:
bool std::operator<<char, std::char_traits<char>, std::allocator<char> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in libtms.a(tms.cc.o)
"std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)", referenced from:
_tms_get_tables in libtms.a(tms.cc.o)
"std::allocator<char>::allocator()", referenced from:
_tms_get_tables in libtms.a(tms.cc.o)
"std::_Rb_tree_decrement(std::_Rb_tree_node_base*)", referenced from:
std::_Rb_tree_iterator<std::pair<std::string const, std::pair<unsigned int, unsigned int> > >::operator--() in libtms.a(tms.cc.o)
"std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()", referenced from:
_tms_get_tables in libtms.a(tms.cc.o)
std::pair<std::string const, std::pair<unsigned int, unsigned int> >::~pair() in libtms.a(tms.cc.o)
"std::allocator<char>::~allocator()", referenced from:
_tms_get_tables in libtms.a(tms.cc.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我正在尝试添加pagar.me SDK
我已经链接了二进制文件
并添加了标题和库搜索路径
启用位码设置为否
并且-lstdc ++已添加到Other Linker Flags