1

I am getting this error:

/Users/AppleMacbook/Documents/Tab/Tab/../../../Downloads/GDataXMLNode.h:38:24: error: libxml/tree.h: No such file or directory

I have added these two properly:

/usr/include/libxml2

other linkers flags   -lxml2

Still I am getting an error saying that tree.h is not present. I opened that folder, it's there!

Could you please help me with this?

jscs
  • 63,694
  • 13
  • 151
  • 195
Legolas
  • 12,145
  • 12
  • 79
  • 132

2 Answers2

1

Do you need /usr/include/ instead or in addition? I notice it's looking for libxml/tree.h but you're including /usr/include/libxml2 ?

Nektarios
  • 10,173
  • 8
  • 63
  • 93
  • This is the path. `usr/include/libxml2/libxml/tree.h` – Legolas Jun 23 '11 at 18:59
  • I don't have Xcode in front of me but in the project setup there are 2 places to list library includes and user-defined includes IIRC. Try to put /usr/include/libxml2/ in both of those places and maybe also check the "recursive" option. – Nektarios Jun 23 '11 at 19:04
  • 1
    Also http://stackoverflow.com/questions/1428847/libxml-tree-h-no-such-file-or-directory exact duplicate? – Nektarios Jun 23 '11 at 19:04
  • Nope I already checked that question. Adding those two cleared his problem. Did you try in ios sdk 5.0 ? – Legolas Jun 23 '11 at 19:07
  • Could potentially be a bug in the beta Xcode 4.2.x... I know I use 4.2.(1?) and include `/usr/include/mysql/` with no issues using this exact type of project setup. I also know I've hit bugs with the beta clang. If you can't solve, install Xcode 4.0.2. If it's a regression, report it to Apple. – Nektarios Jun 23 '11 at 19:12
  • The bug I found had me spend 3 days with cryptic errors trying to cross-compile a gcc. Talk about FML, wow. GL – Nektarios Jun 23 '11 at 19:17
0

you need to specify an include path, in addition to a linker path -I/usr/include/libxml2/libxml, just specify the path (/usr/include/libxml2/libxml) in the build settings. enter image description here

Grady Player
  • 14,399
  • 2
  • 48
  • 76