第一个错误
No matching function for call to ‘iconv’
No matching function for call to ‘iconv_close’
解决:
iconv_close((iconv_t)_iconv);
iconv((iconv_t)_iconv, (char**)&pin, &inLen, &pout, &outLen);
第二个错误
ld: warning: ignoring duplicate libraries: '-lc++', '-lz'
ld: library 'iconv.2.4.0' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)
解决方法
1.去Build Settings 搜索 Other 如图1 添加 -ld64 (这个可以不加)
2.去Build Phases 搜索libiconv删除 如图2
3.在Build Phases里面添加 libiconv libiconv2 个库 图3
图1