Undefined symbols for architecture i386或者armv7: “_OBJC_CLASS_$_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*) in libCoreClientiOS.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*) in libCoreClientiOS.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*) in libCoreClientiOS.a(tolua_gameinterface.o) |
08 |
"Font::LoadFont(std::__1::basic_string,
std::__1::allocator > const&)" ,
referenced from: |
09 |
tolua_gameinterface_Font_loadFont00(lua_State*) in libCoreClientiOS.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*) in libCoreClientiOS.a(tolua_gameinterface.o) |
12 |
"System::MakeResourcePath(std::__1::basic_string,
std::__1::allocator > const&) const"
|