Why am I getting this “libxml/tree.h file not foun

2019-01-21 07:41发布

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 with the same project I get the same error.

I have configured the header search paths with /usr/include/libxml2
I also tried $(SDKROOT) / usr/include/libxml2 and it didn't work.

I have also put Other Linker Flag with lxml2

14条回答
乱世女痞
2楼-- · 2019-01-21 08:16

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

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

查看更多
等我变得足够好
3楼-- · 2019-01-21 08:16

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.

查看更多
啃猪蹄的小仙女
4楼-- · 2019-01-21 08:16

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.

查看更多
beautiful°
5楼-- · 2019-01-21 08:20

LibXML2 library solved

SOLUTION!

if you have xcode 4.3.x in /Application

need ONLY add: "/usr/include/libxml2" without quote in Application TARGET -> Header search path.

for this -> double click on the line -> on little window click plus sign an write /usr/include/libxml2

nb - need also add libxml2.dylib to the framework. I use 2.2.7.3

hope help you

查看更多
劳资没心,怎么记你
6楼-- · 2019-01-21 08:21

I solved the problem by setting the Header Search Path to:

${SDK_DIR}/usr/include/libxml2

and Always Search User Paths to NO (which is strongly suggested anyway) This just in the target.

查看更多
Deceive 欺骗
7楼-- · 2019-01-21 08:21

In debug/release add the search path to Any Architecture | Any SDK That is click the + button near debug and add ${SDKROOT}/usr/include/libxml2 Similarly do the above for release also

查看更多
登录 后发表回答