ios 編譯過程中碰到std::ios_base::Init::~Init()錯誤的問題解決方法


轉載自: http://wicrewoft.blog.51cto.com/210706/1236005 原作者:范國鋒
標簽: libstdc++.6.dylib
如果遇到下面這個問題是因為引用的c++庫不正確導致,xcode 6.1版本需要引用  libstdc++.6.dylib才能解決問題。
 
Undefined symbols for architecture armv6:"std::ios_base::Init::~Init()", referenced from:  ___tcf_0 in libmyCppLib_dev.a(myCppLib.o)"std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)", referenced from:      _show_the_world in libmyCppLib_dev.a(myCppLib.o)"std::ios_base::Init::Init()", referenced from:  __static_initialization_and_destruction_0(int,int)in libmyCppLib_dev.a(myCppLib.o)"std::cout", referenced from:  _show_the_world in libmyCppLib_dev.a(myCppLib.o)ld: symbol(s) not found for architecture armv6collect2: ld returned 1 exit status

 

The correct answer was provided by Jimmy Koerting in the comments: the app needs to be linked against libstdc++.dylib to resolve the standard library symbols. Thanks to Jimmy Koerting, but one more thing i want to add here is, if you are using xcode latest version with iOS 6.1 please add thislibstdc++.6.dylib

 

http://stackoverflow.com/questions/6882817/building-static-c-lib-for-use-with-objective-c-app-in-xcode-4

本文出自 “范國鋒” 博客,請務必保留此出處http://wicrewoft.blog.51cto.com/210706/1236005


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM