简体   繁体   中英

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

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. 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.
  3. Select libxml2.dylib out of the list.

Works fine for my Mac project on Xcode 4.5.2.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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