简体   繁体   English

带有libxml2的Apple Mach-O链接器警告

[英]Apple Mach-O Linker Warning with libxml2

In xcode4.6 I added the libxml2 liberary and edited the "Other Linker Flags" with -lxml2 and "(User) Head Search Paths" with /usr/include/libxml2 and now I get this warning: http://i46.tinypic.com/91icjm.png 在xcode4.6中,我添加了libxml2库,并使用-lxml2编辑了“其他链接器标志”,并使用/ usr / include / libxml2编辑了“(用户)头部搜索路径”,现在得到以下警告: http://i46.tinypic .com / 91icjm.png

Does somebody know how I can solve this? 有人知道我该怎么解决吗?

If you're using the Xcode IDE and a normal Xcode project, adding -lxml2 to the linker flags is not the best way to link with it. 如果您使用的是Xcode IDE和普通的Xcode项目,则将-lxml2添加到链接器标志不是最佳的链接方式。 You're much better off to add it to the project as follows: 您最好将其添加到项目中,如下所示:

  1. Click on the project (the topmost node in file browser) 单击项目(文件浏览器中最顶层的节点)
  2. In Build Phases, under “Link Binary With Libraries”, click the +. 在构建阶段的“将二进制文件与库链接”下,单击+。 You'll get a list of dylibs and frameworks you can link with. 您将获得可以链接的dylib和框架的列表。
  3. Select libxml2.dylib out of the list. 从列表中选择libxml2.dylib。

Works fine for my Mac project on Xcode 4.5.2. 对于Xcode 4.5.2上的Mac项目,可以正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM