libxml/tree.h no such file or directory

后端 未结 22 2933
刺人心
刺人心 2020-11-27 10:47

I am getting following errors.

libxml/tree.h no such file or directory

I have already added libxml2.dylib to my pro

22条回答
  •  天涯浪人
    2020-11-27 10:48

    Blockquote Adding libxml2 in Xcode 4.3.x

    Adding libxml2 is a big, fat, finicky pain in the ass. If you're going to do it do it before you get too far in building your project.

    Here's how.

    Target settings

    Click on your target (not your project) and select "Build Phases". Click on the reveal triangle titled "Link Binary With Libraries". Click on the "+" to add a library. Scroll to the bottom of the list and select "libxml2.dylib". That adds the libxml2 library 2 your project… but wait.

    Project settings

    Now you have to tell your project where to look for it three more times.

    Select the "Build Settings tab". Scroll down to the "Linking" section. Under your project's columns double click on the "Other Linker Flags" row. Click the "+" and add "-lxml2" to the list.

    Still more.

    In the same tab, scroll down to the "Search Paths" section. Under your project's column in the "Framework Search Paths" row add "/usr/lib/libxml2.dylib".

    In the "Header Search Paths" AND the "User Header Search Paths" row add "$(SDKROOT)/usr/include/libxml2". In those last two cases make sure that path is entered in Debug AND Release.

    Then. Under the "Product" Menu select "Clean".

    This is working and for Xcode5 too! Thank you!

提交回复
热议问题