Why am I getting this “libxml/tree.h file not found” error?

后端 未结 14 2101
半阙折子戏
半阙折子戏 2020-12-12 22:15

I just installed Xcode version 4.3.1 and I get this error:

libxml / tree.h file not found

I have also installed Xcode 4.2, and

相关标签:
14条回答
  • 2020-12-12 22:28

    In your question, you have a space between the / and usr. Perhaps this is a typo, but the path is:

    /usr/include/libxml2
    

    Just confirm that is the path in the target build settings:

    Target build settings

    You can also verify that the path exists on your file system.

    0 讨论(0)
  • 2020-12-12 22:29

    Include the following in your header search path and you should be immune to any weirdness Apple does with their Xcode updates:

    $(SDKROOT)/usr/include/libxml2
    
    0 讨论(0)
  • 2020-12-12 22:29

    The correct path is (for 'Header Search Path'):

    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/usr/include/libxml2/**

    0 讨论(0)
  • 2020-12-12 22:29

    I have the same problem.

    I try set path( 'Header Search Path') to /usr/include/libxml2 ,build error!

    I try set path( 'Header Search Path') to $(SDKROOT)/usr/include/libxml2 ,build error!

    but I set path to

    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/usr/include/libxml2
    

    build succeeded!

    0 讨论(0)
  • 2020-12-12 22:30

    2 solutions:

    1. header search path should be updated with SDK root as such: $(SDKROOT)/usr/include/libxml2
    2. Install command line tools for XCode 5 from terminal by entering: xcode-select --install XCode 4 should have the command line tools install option in preferences>downloads section.

    I'd personally go with the second one.

    0 讨论(0)
  • 2020-12-12 22:33

    Xcode 6:

    Do the following:

    1.0)Select "mainApp" Target : Go to settings ->In "Header Search Path"

    1.1)Add this: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/libxml2.

    2.0)Select "TestApp" Target : Go to settings ->In "Header Search Path"

    2.1)Add this: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/libxml2.

    0 讨论(0)
提交回复
热议问题