Linking Error libxml2.dylib at Xcode 3.2.5 & SDK 4.2
Asked Answered
T

3

7

I am trying to connect to twitter using oauth library. The library needs libxml2.dylib to be added. When adding this to SDK 4.1 or less the project build successfully. But when I use that with xcode 3.2.5 and SDK 4.2 I got errors about missing headers

I just add the libxml2.dylib to frameworks then from target configuration I add "${SDKROOT}/usr/include/libxml2" to the header search path.

I got error: libxml/xmlreader.h: No such file or directory.

the twitter oauth library I am trying to add is Twitter+OAuth, here's a tutorial where u can see that the src project it has, works correctly on SDK 4.1, and not even compile at SDK4.2 http://mobile.tutsplus.com/tutorials/iphone/twitter-api-iphone/

what I miss?

Thicket answered 8/12, 2010 at 19:49 Comment(0)
T
18

After trying several things, I found I have to change the header search path to /usr/include/libxml2/** instead of ${SDKROOT}/usr/include/libxml2/**

Thicket answered 21/12, 2010 at 17:39 Comment(1)
Upgraded from Xcode 4.0 to 4.2 and this worked like a charm.. :)Untwine
O
0

Select "All Configurations" (I prefer the project info unless I have very different targets), double-click the header search path field, enter the path and make sure to check the "Recursive" checkbox. The resulting path should have 2 asterisks. If you set the header search path for the project, all the targets should inherit it properly.

The tutorial you linked to is a bit inconsistent with regard to project/target settings, which is almost certainly the issue. I have verified that xmlreader.h is present in SDK 4.2.

Orthogenesis answered 8/12, 2010 at 21:16 Comment(1)
This doesn't fix the problem, I tried to add the lib to my project (not the tutorial one) and got same resultsThicket
T
0

I had the same issue, then i realized that i was only adding the header search path in the target section, and not in the project.. be sure that it is in both sides.

Trochal answered 25/1, 2012 at 13:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.