xcode4 中 libxml2.a 编译错误
我刚刚将 xcode3.2.5 升级到 xcode4.0 。
但是当我重建以前的项目时,发生了以下错误:
架构armv6的未定义符号: “_iconv”,引用自: libxml2.a(encoding.o) 中的 _xmlIconvWrapper “_iconv_close”,引用自: libxml2.a(encoding.o) 中的 _xmlFindCharEncodingHandler libxml2.a(encoding.o) 中的 _xmlCharEncCloseFunc “_iconv_open”,引用自: libxml2.a(encoding.o) 中的 _xmlFindCharEncodingHandler ld:未找到架构armv6的符号 collect2: ld 返回 1 退出状态
任何人帮忙...
I just upgrade my xcode3.2.5 to the xcode4.0 .
But when I rebuild my previous project, errors happened below:
Undefined symbols for architecture armv6:
"_iconv", referenced from:
_xmlIconvWrapper in libxml2.a(encoding.o)
"_iconv_close", referenced from:
_xmlFindCharEncodingHandler in libxml2.a(encoding.o)
_xmlCharEncCloseFunc in libxml2.a(encoding.o)
"_iconv_open", referenced from:
_xmlFindCharEncodingHandler in libxml2.a(encoding.o)
ld: symbol(s) not found for architecture armv6
collect2: ld returned 1 exit status
Anyone help...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
不知道你是否还需要答案。似乎您缺少与 libiconv.dylib 的链接。
Don't know whether you still need the answer or not. Seems like you are missing linking with libiconv.dylib.
听起来 libxml2.a 静态库可能没有为您的目标架构(armv6)构建。尝试重建它,或者...
可以动态地链接libxml2(它包含在iOS中)。为此,请选择目标 >构建阶段>将二进制文件与库链接>单击添加并从下拉菜单中选择 libxml2.dylib。
Sounds like the libxml2.a static library may not have been built for your target architecture (armv6). Try rebuilding that, or...
It is possible to link against libxml2 dynamically (it is included in iOS). To do so, select the target > build phases > link binary with libraries > click add and select libxml2.dylib from the drop down menu.
您应该将标头路径设置为
$(PROJECT_DIR)/Your libiconv Dir/**include**
(例如,
$(PROJECT_DIR)/libiconv-1.14/include
)。并设置库路径。
然后,选中“链接二进制文件与库”。
如果您未将
libiconv.a
(或libiconv.dylib
)设置为“Link Binary With Libraries”,请设置它。您可以检查 Target 成员身份的另一种方法:项目文件夹树 [参见 Xcode 左侧] ->选择
libiconv
库 ->检查目标成员资格(选中复选框)[参见 Xcode 右侧]。You should set Header path to
$(PROJECT_DIR)/Your libiconv Dir/**include**
(e.g,
$(PROJECT_DIR)/libiconv-1.14/include
).And set Library path.
Then, check "Link Binary With Libraries".
If you do not set
libiconv.a
(orlibiconv.dylib
) to "Link Binary With Libraries" , set it.Another method that you can check Target membership: project folder tree [see, Xcode left side] -> select
libiconv
libraries -> check Target Membership (check box on)[see, Xcode right side].