xcode7: Undefined symbols for architecture i386: "_iconv_open", referenced from:

在整合cocos和quick时,出现这个错误,我按照以前的方法

link binary with libraries 中add libiconv.2.dylib ,发现已经没有了这个库。

网上找了一下,找到一个:

问题:

I use libxml to save game data. in order to support chinese character, i use iconv to convert format.
but a linke error was appeard:

Undefined symbols for architecture i386:
"_iconv_open", referenced from:
FConverter::code_convert(char*, char*, char*, unsigned long, char*, unsigned long)in GameData.o
"_iconv", referenced from:
FConverter::code_convert(char*, char*, char*, unsigned long, char*, unsigned long)in GameData.o
"_iconv_close", referenced from:
FConverter::code_convert(char*, char*, char*, unsigned long, char*, unsigned long)in GameData.o
ld: symbol(s) not found for architecture i386

I was not familiar with mac os and xcode, so i try to resolve it refer to visual c++.
I found a configuration in target/Build Phase and search iconv, there are three dylib under the list.
libiconv.2.4.0.dylib
libiconv.2.dylib
libiconv.dylib.
i select libiconv.dylib. compile error was resolved.

but i am not sure is this the best solution, and will it cause another problem later.

does dylib mean dynamic library like dll? if i have to public or share my application with this dylib file as windows application combine dll file.

thanks a lot.
:D

 

解答:

After Xcode 7, Apple did a lot to strip the size of apps, including changing .dylib to .tbd.
Here you don't need to add library & framework but you can add the library by changing the following option:
Other Linker Flags > Add "-l{yourlibraryname} (no space after -l)
In your case, you can add -liconv in Other Linker Flags.

原文地址:http://discuss.cocos2d-x.org/t/link-error-in-xcode-4-2-iconv-error/1173

转载于:https://www.cnblogs.com/ZhYQ-Note/p/5911861.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值