這段時間在搞音視頻相關的項目,所以調研了一番決定使用bilibili的ijkplayer,但是在集成的過程中遇到了這個錯誤,所以貼出來作為筆記,也希望對遇到同樣問題的童鞋有點幫助。
其實就是添加了C++模塊,但是沒有添加相關兼容的庫而已,只需要添加libstdc++.6.0.9.tdb就可以了。
最后貼出來我google問題的時候找到的相關答案
Apple Mach-O Linker Error 解決辦法
2015-07-27 17:10:16
iOS項目中引入c++庫,編譯鏈接時報如下錯:
"std::string::_Rep::_M_destroy(std::allocatorconst&)", referenced from:
"std::_List_node_base::hook(std::_List_node_base*)", referenced from:
"std::string::push_back(char)", referenced from:
"std::string::append(char const*, unsigned long)", referenced from:
"std::string::_Rep::_S_empty_rep_storage", referenced from:
很明顯,以上都是stdc++標準庫函數。
檢查Build Phases->Link Binary With Libraries 也包含了libstdc++.dylib庫
最終調試發現:libstdc++.dylib實際不是一個庫,而是一個快捷方式。
實際使用時,可能出現找不到庫的情況,也可能找得到,人品問題;
然后,解決方案里,直接把libstdc++.dylib換成libstdc++.6.0.9.dylib即可
Build Succeeded~?