ld: symbol(s) not found for architecture x86_64
Undefined symbol: std::string::find(char const*, uns
当前所遇问题,用xcode10 在iOS12模拟器运行的时候会报这个错误,用iOS11模拟器试过也不行,但是使用真机运行的话没有问题。
Undefined symbolsforarchitecture x86_64:"std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)",referenced from:_baidu_framework::HandleBasemapMerge(_baidu_vi::CVStringconst&,_baidu_vi::CVStringconst&,_baidu_vi::CVStringconst&,charconst*)inBaiduMapAPI_Map(BVMDOfflineMapMerge.o)"std::string::assign(std::string const&)",referenced from:_baidu_framework::HandleBasemapMerge(_baidu_vi::CVStringconst&,_baidu_vi::CVStringconst&,_baidu_vi::CVStringconst&,charconst*)inBaiduMapAPI_Map(BVMDOfflineMapMerge.o)"std::basic_fstream<char, std::char_traits<char> >::open(char const*, std::_Ios_Openmode)",referenced from:_baidu_framework::HandleBasemapMerge(_baidu_vi::CVStringconst&,_baidu_vi::CVStringconst&,_baidu_vi::CVStringconst&,charconst*)inBaiduMapAPI_Map(BVMDOfflineMapMerge.o)"std::basic_fstream<char, std::char_traits<char> >::close()",referenced from:_baidu_framework::HandleBasemapMerge(_baidu_vi::CVStringconst&,_baidu_vi::CVStringconst&,_baidu_vi::CVStringconst&,charconst*)inBaiduMapAPI_Map(BVMDOfflineMapMerge.o)"std::string::_Rep::_S_empty_rep_storage",referenced from:_baidu_framework::HandleBasemapMerge(_baidu_vi::CVStringconst&,_baidu_vi::CVStringconst&,_baidu_vi::CVStringconst&,charconst*)inBaiduMapAPI_Map(BVMDOfflineMapMerge.o)"std::ios_base::Init::~Init()",referenced .....
解决办法:~/Library/Developer/Xcode/DerivedData 删除DerivedData文件内容
ps: 我只删除了DerivedData文件中的当前项目所对应的目录,重新打开Xcode,build之后,模拟器 真机都运行OK
网友评论