'libxml/xmlversion.h' file not found in xcode 4.2?
Asked Answered
R

9

24

i am integrating twitter application in my application my application is created in xcode 4.2 using ARC when i implemented code for twitter from this code. it worked perfectly when i just download the project & run it. when i integrate this twitter sdk code in my xcode 4.2 based application it gave me error of 'libxml/xmlreader.h' file not found i have solved it just changing header file this way #include <libxml2/libxml/xmlreader.h> but after changing this previous error was solved but than i got new error 'libxml/xmlversion.h' file not found. i tried to change header of file xmlreader.h but this file is not editable i have changed permissions for this file, too. but it didn't work. in the format like this #include <libxml2/libxml/xmlreader.h> but it doesn't work.

please tell me how to solve this error.

i have seen several question in stack overflow for some that kind of question

but they didn't work for me in xcode 4.2. please guide me.

Redcap answered 13/1, 2012 at 12:41 Comment(9)
i thought that is ARC error so i have also disable ARC than tried but it didn't work. one more question some time my application receive memory warning in Enabled form of ARC also so than what should i do?Redcap
re ARC issues that is a separate issue and should be a separate questionHyperbaton
What does the build show was used for CompileC ?Hyperbaton
do you asking for this build options->complire for c/c++/objective c in this i have used compiler Apple LLVM compiler 3.0Redcap
No I am asking for the command that Xcode ran to compile the codeHyperbaton
sorry i don't know how to see this? can you be more specific.Redcap
let us continue this discussion in chatRedcap
I had this problem and realized that the -"- character at the beginning of the header search path was missing. After fixing ${SDK_DIR}" to "${SDK_DIR}" it worked.Brock
I was able to fix the error by adding "$(SDKROOT)/usr/include/libxml2" (including double quotes) in Targets > Build Settings > Header Search PathsSpiccato
F
27

Works for me. Remember to add the library in Link Binary en Build Phases Section of the target project. pic2 pic1

Finicky answered 30/1, 2012 at 12:2 Comment(1)
I needed to add the header search paths.Demoss
H
29

You need to put all the libxml headers on the include path. For Xcode do this by adding /usr/include/libxml2 to the header paths (that will pass -I/usr/include/libxml2 to the c compiler)

This is in the build settings tab in Search Paths -> Header Search Paths

enter image description here

Hyperbaton answered 13/1, 2012 at 12:48 Comment(4)
thnx dude, but i have already read this answer in stack overflow and i have also tried like this but it didn't work for me. some what like this #include </usr/include/libxml2/libxml/xmlreader.h>Redcap
That will not work as it will not get all the files. What answer did you find?Hyperbaton
thnks for your picture information but i have already tried like this but it gives me same error as i have asked question.Redcap
add "${SDK_DIR}"/usr/include/libxml2Interosculate
F
27

Works for me. Remember to add the library in Link Binary en Build Phases Section of the target project. pic2 pic1

Finicky answered 30/1, 2012 at 12:2 Comment(1)
I needed to add the header search paths.Demoss
L
25

Go to Project -> Build Settings and search for "User Header Search Paths" key and add this value:

"${SDK_DIR}"/usr/include/libxml2

It works perfectly in my xcode 4.5 + iOS 6

Loam answered 13/9, 2012 at 8:31 Comment(1)
This is also better than the other solutions because it correctly uses the include files in Xcode's SDK, rather than the system headers.Unsaid
P
3

I had the same problem as you. For me the problem was that I setup "Header Search Path" in Project Build Settings, but my Target Build Settings overrided that setting. I fixed this by adding $(inherited) line to Target Build Settings Header Search Paths.

Phototypography answered 7/2, 2012 at 13:17 Comment(0)
M
3

If you're using CocoaPods and get this error, you'll have to fork the spec and the following lines to it:

s.libraries = 'xml2'
s.xcconfig = { 'HEADER_SEARCH_PATHS' => '$(SDKROOT)/usr/include/libxml2' }

You'll have to remove the Pod, then re-install it as well, with the podspec pointing to your fork. The reason why you have to fork the Pod is because the Target where you would normally change this is generated by CocoaPods when you perform pod install.

Note that if you have other libraries that the Pod depends on, include them on the s.libraries line.

Source for this fix in the CocoaPods issue "Pod Integration Issues"

Materiel answered 30/7, 2013 at 2:24 Comment(0)
A
2

In your build settings, for the key "Header Search Paths", add "$(SDK_DIR)"/usr/include/libxml2

I got the same errors and come to here, then I find the answer in below url https://github.com/ZaBlanc/RaptureXML#adding-rapturexml-to-your-project

Hope this can help you, I've solved it now.

Arnone answered 4/6, 2012 at 6:24 Comment(0)
H
0

Add header search path as $(SDKROOT)/usr/include/libxml2

Holiness answered 2/7, 2012 at 12:33 Comment(0)
O
0

Be sure to use the non-recursive option when you add the key "Header Search Paths."

/usr/include/libxml2 -- This is the non-recurisve option

/usr/include/libxml2\** -- This is the recursive option and WILL

Ophthalmologist answered 24/6, 2013 at 6:13 Comment(0)
T
0

In XCode 5:

  1. Add "${SDK_DIR}"/usr/include/libxml2 to your Header Search Paths
  2. Add libxml2.dylib in Build Phases
Trillby answered 4/3, 2014 at 23:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.