Can't find headers for libxml2 and iOS 5.0 SDK / Xcode 4.2 (beta 3)

Wolfgang Schreurs picture Wolfgang Schreurs · Jul 23, 2011 · Viewed 10.4k times · Source

Seems quite a few people have encountered this issue on the official Apple Developer forums, yet didn't find a solution yet, therefore I want to try my luck here :)

With the iOS 5.0 SDK and Xcode 4.2 (beta 3) it seems something is messed up, the headers for libxml2 cannot be found. Yet as I navigate through the SDK directory, I clearly see a folder called libxml2/libxml with all the headers I need to import.

I wonder if anyone has found a solution for this. So far the only solution I found that might work is copying all headers into the project and then modifying the import path of the headers (removing the directory from the imports). As far as I could see this removes all errors, yet couldn't be bothered to change all import statements of libxml yet since I don't like this "fix".

Answer

Wolfgang Schreurs picture Wolfgang Schreurs · Jul 23, 2011

I found the solution in another answer on StackOverflow, I'll post it here for convenience.

Instead of using ${SDK_ROOT}/usr/include/libxml2 one should use "${SDK_DIR}"/usr/include/libxml2.

See: LibXML2.dylib and Xcode4