mavericks / xcode5.0.1如何更改编译器和链接器? [英] How mavericks/xcode5.0.1 changed the compiler and linker?

查看:252
本文介绍了mavericks / xcode5.0.1如何更改编译器和链接器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将系统从10.8升级到10.9,相应地将xcode从5.0升级到5.0.1。

I upgraded a system from 10.8 to 10.9 and correspondingly for xcode from 5.0 to 5.0.1.

当我尝试运行我的一部分构建将多个.a文件合并为一个更大的共享库:

I'm rewarded when I try to run a part of my build that combines multiple .a files into a single, larger, shared lib:

Undefined symbols for architecture x86_64:
"__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13find_first_ofEPKcmm", referenced from:             
__ZN2bt3fst12FstLookupSet14loadFromStringERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEESA_ in libbtfst.a(bt_fst_factory.o)

过滤的问题符号是:

__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13find_first_ofEPKcmm
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::find_first_of(char const*, unsigned long, unsigned long) const

链接命令行看起来像:

libtool -macosx_version_min 10.6  -headerpad_max_install_names -dynamic -multiply_defined suppress -install_name `basename ../../../../rlp/lib/amd64-darwin12-xcode5/libbtutils.dylib` -o ../../../../rlp/lib/amd64-darwin12-xcode5/libbtutils.dylib -g   <long list of .a files>  -lstdc++.6 -lSystem


推荐答案

使用较新的libc ++编译了一些对象,这在10.6中不被支持,并且与您在链接过程中使用的库相矛盾。

It looks like you've compiled some of the objects using the newer libc++, which isn't supported under 10.6, and contradicts the library you are using during linking.

您可以指定库在编译期间使用 -stdlib = libstdc ++ ,还需要确保指定 -mmacosx-version-min = 10.6 在编译期间,这可能有相同的效果,但显式声明部署目标。

You can specify the library to use during a compile using -stdlib=libstdc++ and you also need to ensure you specify -mmacosx-version-min=10.6 during compilation, which might have the same effect, but explicitly declares the deployment target.

这篇关于mavericks / xcode5.0.1如何更改编译器和链接器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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