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

来源:互联网 发布:木马盗号软件 编辑:程序博客网 时间:2024/06/06 05:58

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

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

来自:http://www.yoech.com/undefined-symbols-for-architecture-armv7/

0 0