在工程中导入XMPP第三库时,出现link错误,错误如下:
Undefined symbols for architecture i386:
"_iconv", referenced from:
_mem_cd_iconv in libidn.a(striconv.o)
_str_cd_iconv in libidn.a(striconv.o)
(maybe you meant: _str_iconv, _str_cd_iconv , _mem_cd_iconv )
"_iconv_close", referenced from:
_str_iconv in libidn.a(striconv.o)
"_iconv_open", referenced from:
_str_iconv in libidn.a(striconv.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
起初我以为是路径问题,库文件没导好。但是反复检查发现,不是这样的。libidn.a这个静态库已经在Link Binary With Libraries里。在网上查了很久的资料,最后在中午的时候想到other linker flags这个参数设置,于是找到发现这个参数设置是-all-load,将它删除后,再运行无错误,问题解决。下午就查了些关于这个参数的一些资料。