1

Hi in my Xcode project I included libxml2.dylib framework. I am still getting a error:

libxml2/tree.h not found.

How to resolve this issue?

I didn't give any search header paths. I am using Xcode 4.2

Binarian
  • 12,296
  • 8
  • 53
  • 84
Bharath
  • 161
  • 1
  • 3
  • 13

4 Answers4

4

In my own projects that use libxml2, I modified the Header Search paths to explicitly tell the compiler where to find the header files:

pointer to where the libxml2 header files are

As you can tell from the "$(SDKROOT)" bit, it's actually built into the SDK that gets installed with Xcode.

Michael Dautermann
  • 88,797
  • 17
  • 166
  • 215
  • That path whatever you are showing there is common for all the users or it might change ? I added that path which is showing on the above scree shot..still I am getting same error. – Bharath May 14 '12 at 05:44
  • it'd be common for all users on a machine (SDKROOT should be the same). See if you can find tree.h in the libxml2 directory in the SDK. In my case, I think you should be including "`libxml/tree.h`". It exists inside a libxml folder within the libxml2 folder of the SDK. – Michael Dautermann May 14 '12 at 05:50
  • @Bharath - try changing the "Always Search User Paths" (just above "Header Search Paths" in above pic) to "Yes". The above example only worked for me after changing that value. – Kristen Waite Jun 20 '13 at 18:35
2

change the Header Search Paths to this:

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

you are welcome :)

j0k
  • 22,600
  • 28
  • 79
  • 90
Andy Shang
  • 21
  • 3
  • This might not work for everyone depending on their sdk version - i.e. "iPhoneOS5.1.sdk" might need to be changed to "iPhoneOS6.1.sdk". (Check contents of /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs to verify.) – Kristen Waite Jun 20 '13 at 18:33
0

Read this documents.........i think this url is helpful for you....

see this topic in this url Setting up your project file

if you did not know header search path in Xcode , then follow step

go to target->click on BUild Setting-> search heder in search bar -> then you see search Path -> and check header search path

you go in Build Phase "Link with binary Libarys" and add libxml2 frame work

 You follow all step after use step then click all tab (not combined tab) 
Deepesh
  • 8,065
  • 3
  • 28
  • 45
  • I think you start app from xcode 3.2 and now you work on xcode 4.2 so you can not found. – Deepesh May 14 '12 at 05:58
  • see my update answer 100 % your problem solve , use check in combined tab, please check in all tab and search header path , solve it you problem – Deepesh May 14 '12 at 06:31
0

I have similar issue and fix issue by following steps as per this article :

http://www.optimusmobility.com/2013/06/11/how-to-resolve-libxmltree-h-file-not-found-error/

NSS
  • 721
  • 1
  • 10
  • 23