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

转载于:https://www.cnblogs.com/huangzizhu/p/4109085.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值