IOS7(仅)stdlibc ++链接问题 [英] IOS7 (only) stdlibc++ linking issue

查看:169
本文介绍了IOS7(仅)stdlibc ++链接问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要帮助。
我有一个使用stdc ++的框架,比如std:string。
现在当我为IOS7创建新应用程序时,由于stdc ++ lib的问题,链接此框架存在问题:

I need help. I had a framwork which was using stdc++ like std:string. Now when i have created new app for IOS7 only there is problem with linking this framework because of problems with stdc++ lib:

架构armv7 $ b的未定义符号$ bstd :: basic_string,std :: allocator> :: _ Rep :: _ S_empty_rep_storage,引用自......

Undefined symbols for architecture armv7 "std::basic_string, std::allocator >::_Rep::_S_empty_rep_storage", referenced from ...

我发现一些奇怪的事情,当我在这个应用程序中将Deplyment目标更改为ios6一切正常。
使用ios7,我看到错误。

I have find out something strange that when i change the Deplyment target to ios6 in this app all is working fine. With ios7 i see errors.

我已经在其他链接器标志中设置了标志:-lstdc ++

I already have flag set in other linker flags: -lstdc++

不知道自己做错了什么?

Any idea what ami doing wrong?

推荐答案

关于这个答案的更新:

这一步非常重要!

确保 C ++标准库设置为 libstdc ++(GNU c ++标准) Apple LLVM 5.0编译器构建设置中的库)

背景:

我有一个iOS应用程序突然停止为iOS 7构建标准库链接错误。我一直在模拟器和iPad mini上成功测试应用程序,并将其存档,但是当我添加iPhone 5S进行测试时,我开始收到链接错误(可能是因为混合中的新架构?)。

I have an iOS app that abruptly stopped building for iOS 7 with standard library link errors. I had been testing the app successfully on the simulator and on an iPad mini, and archived it as well, but when I added an iPhone 5S for testing, I started getting link errors (possibly because of a new architecture in the mix?).

搜索Google上的链接错误,我找到了将libstdc ++。dylib显式添加到链接库的建议。这不起作用。

Searching the link errors on Google, I found advice to explicitly add libstdc++.dylib to the linked libraries. This did not work.

我通过将libstdc ++。6.dylib添加到链接库来实验;这消除了链接错误,但应用程序很早就在标准C ++库代码中崩溃了。

I experimented by adding libstdc++.6.dylib to the linked libraries instead; this eliminated the link errors, but the app crashed in the standard C++ library code very early.

删除库的显式添加并更改Build Settings中的编译器设置,如上所述,纠正了链接错误和运行时问题。

Removing the explicit additions of the library and changing the compiler setting in Build Settings, as noted above, corrected the link errors and runtime problem.

感谢rimestad指针!

Thanks to rimestad for the pointer!

这篇关于IOS7(仅)stdlibc ++链接问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆