Undefined symbols for architecture i386:
“_OBJC_CLASS_$_XXX”, referenced from:
objc-class-ref in XXX
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
如果真机调试就是 undefined symbols for architecture armv7错误!
发生这种错误通常是project.pbxproj这个文件引起的,尤其在多人合作开发的时候,svn提交不规范可能导致project.pbxproj发生错误,导致文件的引用不在project.pbxproj文件中。
xcode项目import文件会根据project.pbxproj来查找,查找不到文件的引用则会有上述的错误。
解决方法点击工程,在主界面中点击Build Phases,根据提示信息“XXX”来判断缺少什么文件,一般如果缺少自定义的文件,XXX会是缺少的类名,那么就在Complie Sources中加入该文件。如果缺少类库,则在Link Binary With Libraries中加入该类库。
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) |
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) |
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 足够了。
分类: iOS |2013-07-18 16:49 |42人阅读
今天,使用了第三方一个库,结果,出现,iOS Undefined symbols for architecture armv7 std::basic_string<char, std::char_traits<char>
注意:不是修改Build Setting里面的设置,而是添加一个libstdc++.dylib, 搞定!
- iOS工程集成支付宝错误Undefined symbols for architecture armv7
问题描述: 新工程中需要集成支付宝功能,于是咱就把支付宝的库给集成了进入然后就出现了下面这种错误了说,错误信息如下: Undefined symbols for architecture armv7: ...
- 静态库引入引起的错误解决方案,ld: warning: ignoring file ”…/XXX.a”, file was built for archive which is not the architecture being linked (armv7): “…/XXX.a” Undefined symbols for architecture armv7: "_OBJC_CLASS_$
想目中不免会引入一些静态库,可是有时加入'.a'文件后编译便会报以下错误 ld: warning: ignoring file ”…/XXX.a”, file was built for archiv ...
- Undefined symbols for architecture armv7
xcode编译过程中出现如下问题Undefined symbols for architecture armv7:... ld: symbol(s) not found for architectur ...
- Undefined symbols for architecture armv7: "_OBJC_METACLASS_$_ _OBJC_CLASS_$_ ld: symbol(s) not found for architecture armv7错误
Undefined symbols for architecture armv7: "_OBJC_METACLASS_$_MWPhotoBrowser", referenced ...
- Undefined symbols for architecture armv7错误解决方法
Undefined symbols for architecture armv7: "_OBJC_CLASS_$_BriefMainModel", referenced from: ...
- iOS 错误 undefined symbols for architecture i386
undefined symbols for architecture i386 这个错误困扰了我几个小时. 网上很多问这个问题的,回答基本上都是说在 target 里面去的 armv64 什么什么的. ...
- iOS Undefined symbols for architecture armv7:
armv6 iPhone.iPhone 3G iPod 1G.iPod 2G armv7 iPhone 3GS.iPhone 4 iPod 3G.iPod 4G.iPod 5G iPad.iPad 2 ...
- iOS模拟器:Undefined symbols for architecture x86_64
描述:为了适配iPhone 5s的64位处理器,在编译选项中加入了arm64架构.但是发现工程在真机上可以编译通过但是在模拟器上却未编过. 问题解决:经研究在编译选项中再加入x86_64架构,重新编译 ...
- iOS :undefined symbols for architecture x86_64
转自:http://www.th7.cn/Program/IOS/201408/268371.shtml 问题描述:为了适配iPhone 5s的64位处理器,在编译选项中加入了arm64架构.但是发现 ...
随机推荐
- oracle本月、上月、去年同月第一天最后一天
select trunc(sysdate, 'month') 本月第一天, trunc(last_day(sysdate)) 本月最后一天, trunc(add_month ...
- ffprobe使用具体解释
夹 1. 语法 2. 描写叙述 3. 选项 3.1 流指示符 3.2 通用选项 3.3 音视频选项 3.4 主选项 4. 写入器 4.1 默认值 4.2 compact, csv 4.3 flat 4 ...
- thinkphp连接oracle
配置文件中: //Oracle 测试环境 'DB_TYPE' => 'Oracle', // 数据库类型 'DB_HOST' => '1 ...
- Getting started with new I/O (NIO)--reference
The new input/output (NIO) library, introduced with JDK 1.4, provides high-speed, block-oriented I/O ...
- Google Map API v2 (四)----- 导航路径
仍然是建议个异步小任务 private GetPathTask mGetPathTask = null; private void getGuidePath(LatLng origin){ if(mG ...
- springMvc中406错误解决,springMvc使用json出现406 (Not Acceptable)
springMvc中406错误解决, springMvc使用json出现406 (Not Acceptable) >>>>>>>>>>> ...
- day-8
/* 倒数8天了 今天高考报名 两个班主任都来了23333 然后填班主任姓名就尴尬了23333 上午考试 挺不错的题目 都不是很水 但需要思考 而我是一脸的懵逼~~ 下午整理各种板子 主要是图论的 最 ...
- MAC OS X API知识摘抄
本文为信息为网上各个地方收集整理Carbon和Cocoa,Toolbox,POSIX,JAVA并列成为Mac OS X五个主要的API.与Cocoa相较之下,Carbon是非物件导向(Procedur ...
- 程序员带你十天快速入门Python,玩转电脑软件开发(一)
关注今日头条-做全栈攻城狮,学代码也要读书,爱全栈,更爱生活.提供程序员技术及生活指导干货. 如果你真想学习,请评论学过的每篇文章,记录学习的痕迹. 请把所有教程文章中所提及的代码,最少敲写三遍,达到 ...
- c语言学习之基础知识点介绍(七):循环结构
本节主要介绍循环结构 一.while循环 /* 语法: while(表达式){ //循环体; } 注意:循环变量.循环条件和循环控制语句三者缺一不可. 例如: */ ; //循环变量 ){ //循环条 ...