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

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

File libxml / tree.h not found

I also installed Xcode 4.2, and with the same project I get the same error.

I have configured header search paths with /usr/include/libxml2
I also tried $(SDKROOT) / usr/include/libxml2 and it did not work.

I also added another Linker flag with lxml2

+43
iphone xcode libxml2
Mar 12 '12 at 12:14
source share
14 answers

Include the following in the header search path, and you should be protected from any weirdness that Apple does with their Xcode updates:

 $(SDKROOT)/usr/include/libxml2 
+98
Mar 19 2018-12-12T00:
source share

In your question, you have a space between / and usr . This may be a typo, but the way is:

 /usr/include/libxml2 

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

Target build settings

You can also check if the path to your file system exists.

+27
Mar 12 2018-12-12T00:
source share

LibXML2 library solved

DECISION!

if you have xcode 4.3.x in / Application

you ONLY need to add: "/ usr / include / libxml2" without a quote from the TARGET application β†’ the header search path.

to do this β†’ double click on the line β†’ on a small click on the window plus the sign / usr / include / libxml 2

nb - you also need to add libxml2.dylib to the framework. I am using 2.2.7.3

I hope, you

+19
Jun 08 '12 at 14:50
source share

In 4.3.1, you must specify the search paths for headers in the targets, as well as the project. I'm not sure if this is a problem with upgrading from 4.2 to 4.3.1, but I just upgrade to Lion and run into the same problem.

+7
Mar 13 2018-12-12T00:
source share

I solved the problem by setting the header search path to:

 ${SDK_DIR}/usr/include/libxml2 

and always look for user paths to NO (which is highly recommended anyway) This is just the target.

+7
Mar 20 2018-12-21T00:
source share

Today I came across this, I would recommend that you wrap the path in quotation marks:

 "$(SDKROOT)/usr/include/libxml2" 

I spent half an hour on this due to the presence of gaps in my path.

+4
Mar 14 '13 at 16:08
source share

The correct path (for "Header Search Path"):

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

+3
Mar 13 2018-12-12T00:
source share

Xcode 6:

Follow these steps:

1.0) Select "mainApp" Purpose: go to settings β†’ In the "Title 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" Purpose: 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.

+3
Dec 02
source share

I have the same problem.

I am trying to set the path ("header search path") to /usr/include/libxml2 , build an error!

I am trying to set the path ("header search path") to $(SDKROOT)/usr/include/libxml2 , build an error!

but I set the path to

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

managed to build!

+2
Mar 16 '12 at 3:21
source share

2 solutions:

  • The header search path should be updated using the SDK root as such: $(SDKROOT)/usr/include/libxml2
  • Install the command line tools for Xcode 5 from the terminal by typing: xcode-select --install XCode 4 should have the option to install command line tools in the settings> boot section.

I would personally go with the second.

+2
Dec 18 '13 at 9:28
source share

I already had a header search path and frame, but it was getting this error. Strongly discontinuing xcode and then restarting it worked for me (I used xcode 7.2)

+1
Jan 15 '16 at 11:28
source share

I had to configure other Linker Flags as follows: for Debug and Release do Add Build Settings (lower right corner) and Add Conditional Settings . Then select Any iOS Simulator SDK and paste the -lxml2

0
Jul 25 2018-12-12T00:
source share

In my case, the main difficulty was that the application consists of two projects, and the second has several goals. It took me a while to realize that the error occurred in one of these goals, and not in the main project. Then I just had to add the famous $(SDKROOT)/usr/include/libxml2 in the header search path for that particular target.

I am using Xcode Version 5.0.1

0
Apr 15 '14 at 8:37
source share

In debug / release, add a search path to any architecture | Any SDK. This click the + button next to the debug and add $ {SDKROOT} / usr / include / libxml2 Similarly do the above for the release as well

0
Apr 29 '16 at 15:31
source share



All Articles