LibXML2.dylib and Xcode4
Asked Answered
M

11

11

I just downloaded Xcode 4 and I cant seem to run my application as the MGTwitter... classes are complaining of a non inclusion error of LibXML2. I have imported it into the frameworks folder, and I have put the following in the header bit in the build settings

$(SDKROOT)/usr/include/libxml2

But I am still getting 65 errors.

Any ideas how to fix this?

Multipurpose answered 4/2, 2011 at 23:29 Comment(2)
What are the errors your getting?Wellthoughtof
#include <libxml/xmlreader.h> No such file or directory. All of the other errors derive from that.Multipurpose
S
22

Try this:

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

Steddman answered 4/2, 2011 at 23:45 Comment(5)
I still have errors as well. Sad that a year and several versions of xcode later, this is still an issue.Reclaim
@Answerbot i have same issue did you find anything helpful?Harrold
Anyone coming across this question regarding upgrading to XCode 4.5, this worked. I had issues with ${SDK_DIR}/usr/include/libxml2 working in XCode 4.4, breaking in 4.5. Julio's suggestion fixed the issue.Faux
I also had to select "always search user user paths"Rosannarosanne
It is not working in Xcode 5. I tried in all the ways. Can u help me out please?Whalen
N
11

LibXML2 library solved

Many confusion around this issue.

SOLUTION

if you have both Xcode 4.3.x & Xcode 4.5 in /Application folder

must add ONLY: /usr/include/libxml2 in Application TARGET > Header search path.

For this double click on the line, on little window click plus sign and write /usr/include/libxml2

nb - need also add libxml2.dylib to the framework. I use 2.2.7.3

hope help you

Nudibranch answered 8/6, 2012 at 14:47 Comment(2)
Be careful when posting copy and paste boilerplate/verbatim answers to multiple questions, these tend to be flagged as "spammy" by the community. If you're doing this then it usually means the questions are duplicates so flag them as such instead.Tantra
Im Sorry... ingenuous mistake.Nudibranch
W
4
  1. Always search user path mark it yes.
  2. Then, remove all previous paths that you have defined manually.
  3. Clean all target.
  4. Analyze or build again.

This works for me.

Whippet answered 20/2, 2012 at 7:4 Comment(1)
woooooooow! I tried every other solution on here and this was the only one that worked. Thanks!Felicitasfelicitate
T
3

If you click on "All" and "Combined" go down to the Search Paths section. Make sure you add $(SDK_DIR)/usr/include/libxml2 to the "Header Search Paths" section and not the "Library Search Paths" section.

Taranto answered 19/8, 2011 at 23:42 Comment(0)
P
1

You need to add also the framework libxml2.dylib

Preparative answered 10/5, 2011 at 9:37 Comment(0)
W
1

Make User Header Search paths empty and write

$(SDK_DIR)"/usr/include/libxml2

in Header Search paths which is above the Library Search Paths

Whalen answered 2/2, 2012 at 6:8 Comment(1)
You've just reworded the answer I accepted. Also, what is the point in answering a question that has already been answered?Multipurpose
A
0

Please try this one:

${SDK_DIR}/usr/include/libxml2
Accuracy answered 8/2, 2012 at 4:16 Comment(0)
L
0

You need to add "$(SDK_DIR)/usr/include/libxml2" in "Release" Category rather then in "Debug" Category under "Header Search Path" if you are putting it into a device.

Loyalty answered 5/4, 2012 at 15:31 Comment(0)
A
0

I think the selected answer is better. However this one worked for me: enter image description here

I just drag and drop.

I do not know why it works. It's how the old programmer do it. I suppose there should be a framework we can include and that should be fine?

Also other computers may not have file libxml2.dylib in that exact spot and things may go wrong.

Antiphrasis answered 10/10, 2012 at 5:15 Comment(0)
I
0
  1. Get info on the target and go to the build tab
  2. Add -lxml2 to the Other Linker Flags property
  3. Add -I/usr/include/libxml2 to the Other C Flags property
Incorporation answered 20/11, 2012 at 6:4 Comment(0)
P
0

I also faced this issue for xcode4.6 , i added libxml2.dylib in header search path added :: "/usr/include/libxml2" and added "AdSupport.framework" and its work for me.

Portie answered 12/4, 2013 at 6:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.