XCode5 libiconv 真机编译提示:Undefined symbols for architecture armv7解决方案 iOS

Cool.Cat 2014-01-10 1914

XCode5.02真机编译项目,提示:
Undefined symbols for architecture armv7: "_libiconv_open", referenced from: SIX_Utility::U2G(char const*) in SIX_Utility.o SIX_Utility::G2U(char const*) in SIX_Utility.o "_libiconv", referenced from: SIX_Utility::U2G(char const*) in SIX_Utility.o SIX_Utility::G2U(char const*) in SIX_Utility.o "_libiconv_close", referenced from: SIX_Utility::U2G(char const*) in SIX_Utility.o SIX_Utility::G2U(char const*) in SIX_Utility.o ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)


右键查看iconv_open定义,来到iconv.h,见红色框部分:

1


 
原来没有定义LIBICONV_PLUG,就会把iconv_open定义为libiconv_open。。。
知道原因就好办了,打开target->build settings,找到preprocessor macros项,把LIBICONV_PLUG增加进宏定义就可以正常编译通过了!

2

最新回复 (0)
返回
发新帖
X