关于Undefined symbols for architecture armv7静态库引用的问题

转自:http://blog.csdn.net/hamasn/article/details/8551895

01 Undefined symbols for architecture i386:
02   "TextureMan::LoadTexture(std::__1::basic_string, std::__1::allocator > const&, int, bool)", referenced from:
03       tolua_gameinterface_TextureMan_loadTexture00(lua_State*) inlibCoreClientiOS.a(tolua_gameinterface.o)
04   "SoundManager::BgndMusicPlay(std::__1::basic_string, std::__1::allocator > const&, bool)", referenced from:
05       tolua_gameinterface_SoundManager_BgndMusicPlay00(lua_State*) inlibCoreClientiOS.a(tolua_gameinterface.o)
06   "SoundManager::BgndMusicStop(std::__1::basic_string, std::__1::allocator > const&, bool)", referenced from:
07       tolua_gameinterface_SoundManager_BgndMusicStop00(lua_State*) inlibCoreClientiOS.a(tolua_gameinterface.o)
08   "Font::LoadFont(std::__1::basic_string, std::__1::allocator > const&)", referenced from:
09       tolua_gameinterface_Font_loadFont00(lua_State*) inlibCoreClientiOS.a(tolua_gameinterface.o)
10   "System::MakeDocumentPath(std::__1::basic_string, std::__1::allocator > const&) const", referenced from:
11       tolua_gameinterface_System_makeDocumentPath00(lua_State*) inlibCoreClientiOS.a(tolua_gameinterface.o)
12   "System::MakeResourcePath(std::__1::basic_string, std::__1::allocator > const&) const", referenced from:
13       ExUnit::LogicThread::Run() in libCoreClientiOS.a(logicthread.o)
14       tolua_gameinterface_System_makeResourcePath00(lua_State*) inlibCoreClientiOS.a(tolua_gameinterface.o)
15   "std::__1::__vector_base_common::__throw_length_error() const", referenced from:
16       void std::__1::vector >::__push_back_slow_path(float const&&&) inlibCoreClientiOS.a(tolua_gameinterface.o)
17       void std::__1::vector, std::__1::allocator > >::__push_back_slow_path const&>(std::__1::basic_string, std::__1::allocator > const&&&) inlibCoreClientiOS.a(tolua_gameinterface.o)
18       void std::__1::vector >::__push_back_slow_path(int const&&&) inlibCoreClientiOS.a(tolua_gameinterface.o)
19   "std::__1::locale::use_facet(std::__1::locale::id&) const", referenced from:
20       std::__1::basic_ostream >& std::__1::endl >(std::__1::basic_ostream >&) inlibCoreClientiOS.a(logicthread.o)
21   "std::__1::ios_base::getloc() const", referenced from:
22       std::__1::basic_ostream >& std::__1::endl >(std::__1::basic_ostream >&) inlibCoreClientiOS.a(logicthread.o)
23   "std::__1::basic_string, std::__1::allocator >::__init(char const*, unsigned long)", referenced from:
24       _l_registercallback in libCoreClientiOS.a(logicthread.o)
25       _luapanic in libCoreClientiOS.a(logicthread.o)
26       ExUnit::LogicThread::Run() in libCoreClientiOS.a(logicthread.o)
27       ExUnit::LogicThread::HandleError() in libCoreClientiOS.a(logicthread.o)
28       ExUnit::LogicThread::CallVA(char const*, char const*, ...) inlibCoreClientiOS.a(logicthread.o)
29       ExUnit::LogicThread::RemoveCallback(char const*) inlibCoreClientiOS.a(logicthread.o)
30       ExUnit::LogicThread::SetCallback(char const*, int) inlibCoreClientiOS.a(logicthread.o)
31       ...
32   "std::__1::basic_string, std::__1::allocator >::assign(char const*)", referenced from:
33       System::SetEngineScriptPath(char const*) inlibCoreClientiOS.a(tolua_gameinterface.o)
34   "std::__1::basic_string, std::__1::allocator >::basic_string(std::__1::basic_string, std::__1::allocator > const&)", referenced from:
35       tolua_gameinterface_vector_string___geti00(lua_State*) inlibCoreClientiOS.a(tolua_gameinterface.o)
36       tolua_gameinterface_vector_string___geti01(lua_State*) inlibCoreClientiOS.a(tolua_gameinterface.o)
37       tolua_gameinterface_vector_string__push_back00(lua_State*) inlibCoreClientiOS.a(tolua_gameinterface.o)
38       void std::__1::vector, std::__1::allocator > >::__push_back_slow_path const&>(std::__1::basic_string, std::__1::allocator > const&&&) inlibCoreClientiOS.a(tolua_gameinterface.o)
39   "std::__1::basic_string, std::__1::allocator >::~basic_string()", referenced from:
40       _l_registercallback in libCoreClientiOS.a(logicthread.o)
41       _luapanic in libCoreClientiOS.a(logicthread.o)
42       ExUnit::LogicThread::Run() in libCoreClientiOS.a(logicthread.o)
43       ExUnit::LogicThread::HandleError() in libCoreClientiOS.a(logicthread.o)
44       ExUnit::LogicThread::CallVA(char const*, char const*, ...) inlibCoreClientiOS.a(logicthread.o)
45       ExUnit::LogicThread::RemoveCallback(char const*) inlibCoreClientiOS.a(logicthread.o)
46       ExUnit::LogicThread::SetCallback(char const*, int) inlibCoreClientiOS.a(logicthread.o)
47       ...
48   "std::__1::basic_string, std::__1::allocator >::operator=(std::__1::basic_string, std::__1::allocator > const&)", referenced from:
49       tolua_gameinterface_vector_string___seti00(lua_State*) inlibCoreClientiOS.a(tolua_gameinterface.o)
50   "std::__1::basic_ostream >::put(char)", referenced from:
51       std::__1::basic_ostream >& std::__1::endl >(std::__1::basic_ostream >&) inlibCoreClientiOS.a(logicthread.o)
52   "std::__1::basic_ostream >::flush()", referenced from:
53       std::__1::basic_ostream >& std::__1::endl >(std::__1::basic_ostream >&) inlibCoreClientiOS.a(logicthread.o)
54   "std::__1::basic_ostream >::sentry::sentry(std::__1::basic_ostream >&)", referenced from:
55       std::__1::basic_ostream >& std::__1::operator<<<std::__1::char_traits >(std::__1::basic_ostream >&, char const*) in libCoreClientiOS.a(logicthread.o)
56   "std::__1::basic_ostream >::sentry::~sentry()", referenced from:
57       std::__1::basic_ostream >& std::__1::operator<<<std::__1::char_traits >(std::__1::basic_ostream >&, char const*) in libCoreClientiOS.a(logicthread.o)
58   "std::__1::cerr", referenced from:
59       ExUnit::LogicThread::Run() in libCoreClientiOS.a(logicthread.o)
60       ExUnit::LogicThread::ContactTriggered(b2Contact*) inlibCoreClientiOS.a(logicthread.o)
61       ExUnit::LogicThread::SensorTriggered(b2Contact*) inlibCoreClientiOS.a(logicthread.o)
62   "std::__1::ctype::id", referenced from:
63       std::__1::basic_ostream >& std::__1::endl >(std::__1::basic_ostream >&) inlibCoreClientiOS.a(logicthread.o)
64   "std::__1::locale::~locale()", referenced from:
65       std::__1::basic_ostream >& std::__1::endl >(std::__1::basic_ostream >&) inlibCoreClientiOS.a(logicthread.o)
66   "std::__1::ios_base::__set_badbit_and_consider_rethrow()", referenced from:
67       std::__1::basic_ostream >& std::__1::operator<<<std::__1::char_traits >(std::__1::basic_ostream >&, char const*) in libCoreClientiOS.a(logicthread.o)
68   "std::__1::ios_base::clear(unsigned int)", referenced from:
69       std::__1::basic_ostream >& std::__1::operator<<<std::__1::char_traits >(std::__1::basic_ostream >&, char const*) in libCoreClientiOS.a(logicthread.o)
70 ld: symbol(s) not found for architecture i386
71 clang: error: linker command failed with exit code 1 (use -v to see invocation)

看着就非常复杂!
有这么多的link STL的错误。
其实,就是你编译静态库的时候使用不同版本的标准库,  C++ Standard Library

那么如何fix掉这个issue呢?看下面这两张图!


如果你这两个在编译静态库和在使用静态库的app中设置的是一样的,应该就可以解决掉这个问题!

事实上,compiler default 足够了。

期待讨论,反馈问题!
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值