Can' get with libxml2.h,file not found, XMPP framework - xmpp

For the last three days I am trying to import XMPP framework and constantly getting this error:"<libxml/tree.h> file not found" in DDXMLNode.h. I copied suggested files to project, created groups, imported necessary libraries,add a flag -lxml2(I tried to add it to project or to target or to them both-nothing helps).I also tried to specify $(SDKROOT)/usr/include/libxml2 in header search path,library search path,users search paths of target,project or in them both - again nothing. I looked at sample project, it works. But they don't specify other linker flags at all. They do header search paths of project and target(and everything is fine). So nothing helps, while sample project with same settings works. Any suggestions?
Additional info: I use xcode 6,target is iOS8, in target's build settings I use -all_load flag for some other sdk's(just in case this matters)

I had same problem. This link helped me out. If you follow instructions step by step, I think it will solve the problem.
Steps can be summarised as:Step 1. Make sure you link CFNetwork framework and Security framework
Step 2. Goto Projects -> Build Settings and add “/usr/include/libxml2” to Header search path
Step 3. Also add “-lxml2” to Other linker flags
Step 4. Add following folders from XMPPFramework to your project:
Authentication, Core, Categories, Utilities, Vendor

Related

lexical or preprocessor issue file not found occurs while archiving?

I am new to this iPhone development and i have almost completed my first application but when i try for creating an archive it gives an error lexical or preprocessed issue file not found But it runs fine in simulator and also has also tested on device. I have included SDwebimage architecture for lazy loading of image in table view.Can any tell me what is the issue?
Few things to try, Ensure the Framework and all it's headers are imported into your project properly.
Also in your Build Settings set YES to Always search user paths, and make sure your User header paths are pointing to the Framework.
Finally, Build->Clean and Restart Xcode.
Hope this helps !
UPDATE: According to SDWebImage's installation, it's required you make a modification to Header Search Path and not User header paths, As seen below.
Have you done this as well? I suggest slowly, re-doing all the installation steps from the beginning.
Spaces in a folder name in your header search path can cause this problem. Make sure the folders in your project do not have spaces in their names.
My project was building fine until I updated to Xcode 10.1. After the Xcode update, started getting Lexical or preprocessor Issue errors on build. Some XCDataModel header files could not be found.
This fixed the issue.
Go to Build Settings, Header Search Paths
Change the appropriate value from $(SRCROOT) non-recursive to recursive.
This ensures that subfolders are also searched for headers during build.
I had this same issue now and found that my sub-projects 'Public Header Folder Path' was set to an incorrect path (when compared with what my main project was using as its 'Header Search Path' and 'User Header Search Path').
e.g.
My main project had the following:
Header Search Paths
Debug "build/Debug-iphoneos/../../Headers"
Release "build/Debug-iphoneos/../../Headers"
And the same for the User Header Search Paths
Whereas my sub-project (dependency) had the following:
Public Header Folder Path
Debug "include/BoxSDK"
Release "include/BoxSDK"
Changing the 'Public Header Folder Path' to "../../Headers/BoxSDK" fixed the problem since the main project was already searching that folder ('../../Headers').
PS: I took some good screenshots, but I am not allowed to post an answer with images until I hit reputation 10 :(
I had this problem after changed project name. I used all the methods mentioned on the internet but still doesn't work. Then I realized that all the header files not found was from cocoapods, so I re-installed the cocoapods using pod install, and thus solved the problem.
Hope this could help.
In my case I was developing a framework and had a test application inside it, what was missing is inside the test application target -> build settings -> Framework Search Paths:
The value needed to be the framework path (the build output - .framework) which is in my case:
"../FrameworkNameFolder/" - the 2 points indicates to go one folder up.
Also, inside the test application target -> Build Phases -> Link Binary With Libraries:
I had to remove the framework file, clean the project, add the framework file again, compile and this also solved the issue.
The new version contain fix for this, feel free to update.
Or you can just replace
#include "iPhone_View.h"
with
#if UNITY_VERSION < 450
#include "iPhone_View.h"
#endif
Delete the unit testing from your project follow the below steps this will solve the issue.
select your project from the project navigator to open the project editor. From the target delete the test from the left side of the project editor and press the Delete key.
I know this is old, but I'm gonna chime in anyway because it may be useful to someone. If you can still see the file in Finder, then click on the file in your project and delete it, selecting "remove references" and not "move to trash".
Once the reference is removed, drag and drop the file from finder into your project again and it should sort itself out.
Just adding another thing that worked for me :
react-native link
Evidently my ReactNative files were no longer there. I could figure that out by clicking on
Build Phases -> Link Binary with Libraries ->
Then right clicking a file I knew was responsible for React, and clicking Show In Finder .
But nothing opened. So assuming the library went missing, I just ran the above command which relinked everything again.
Also if you havn't, try :
rm -rf node_modules/ && npm install
This happened to me after I renamed a file. For some reason it was still looking for the file with the old name. What I did was create the file that it was complaining about and added to the project. Then I did a Project->clean, then Project->Build and verified the error was gone. Then I selected the newly added files and deleted them. This removed all references and I no longer see the error.
I fixed mine. The fb sdk downloaded (from my browser) as 'FacebookSDKs-iOS-4.22.0' -- I just had to rename the folder to FacebookSDK. So now in Build
Settings --> Framework Search Paths
the path looks something like /Users/.../Documents/FacebookSDK (where as before it was /Users/.../Documents/FacebookSDKs-iOS-4.22.0)
Hope this helps!
For what it's worth, my problem was completely unrelated to the error Xcode was giving. I stumbled onto a solution by deleting the .h reference, compiling, adding the reference back and compiling again. The actual error then became evident.

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

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.
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
Works for me.
Remember to add the library in Link Binary en Build Phases Section of the target project.
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
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.
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"
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.
Add header search path as $(SDKROOT)/usr/include/libxml2
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
In XCode 5:
Add "${SDK_DIR}"/usr/include/libxml2 to your Header Search Paths
Add libxml2.dylib in Build Phases

Help using iOSPorts to connect to an LDAP server

I am building an iPhone application which connects to an LDAP server (no encryption). I am trying to use iOSPorts but I am having trouble following the documentation, I think it was written for Xcode 3, while I've only ever used Xcode 4.
All that is required is to do simple search queries of the server and returning the results.
Some of the trouble I am having:
For example in step 3 my iOSPorts/include folder is empty and only contains the .gitignore file.
For step 4 which files do I need to add just the ports folder containing database, devel, iOSPorts and security?
For step 6 the direct dependencies panel, is this the target dependencies of build phases , which libraries need to be selected?
I think step 7 is for Xcode 3 too,
Any help with this would be much appreciated!
I am building an iPhone application which connects to an LDAP server (no encryption). I am trying to use iOSPorts but I am having trouble following the documentation, I think it was written for Xcode 3, while I've only ever used Xcode 4.
The original instructions were created for Xcode 3 since Xcode 4 was still in early beta when I published the first release of iOS Ports. The instructions have been updated within the last month for use with Xcode 4. I try to use the name used by "Xcode 4 User Guide" when describing the steps, so I recommend reading the first few chapters of this document from Apple.
For example in step 3 my iOSPorts/include folder is empty and only contains the .gitignore file.
Initially the include directory will be empty. The individual ports will copy the header files to the include directory. This is to prevent the end developer from needing to add a path to OpenSSL, Cyrus SASL, and OpenLDAP in order to compile an app for OpenLDAP.
Any help with this would be much appreciated!
So here is a quick run down of how iOS Ports works.
Each port of an Open Source package has an Xcode project file. That Xcode project file lists other Xcode project files and Makefiles as dependencies. Here is the high level steps used by an iOS Ports Xcode project file to compile the port:
Execute the port's MakeFile
Makefile: Download the source archive from the Internet (fails if Internet is unavailable)
Makefile: Verifies the integrity of the source archive using md5sum.
Makefile: Unpacks the source archive.
Makefile: Applies any required patches to the source code.
Makefile: Copies headers to the iOS Ports include directory.
Build any libraries from other ports listed in the build settings' Target Dependencies (for instance, libldap.a in OpenLDAP requires libsasl2.a from Cyrus SASL).
Compiles requested library.
The README has more information on how to add the project files to your project and link against the libraries. There also a few example programs in the examples directory.
If you do continue to have problems, please let me know. I try my best to keep on top of requests for help regarding iOS Ports and my other projects.
I haven't gone through all the process, but I am pretty sure for step 3, you have to 'make' the project first. There is a Makefile in the top folder of the project.

Linking Error libxml2.dylib at Xcode 3.2.5 & SDK 4.2

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?
After trying several things, I found I have to change the header search path to /usr/include/libxml2/** instead of ${SDKROOT}/usr/include/libxml2/**
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.
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.

MGTwitterEngine for Iphone SDK errors

I'm trying to get MGTwitterEngine to work for the iPhone SDK. I've followed the read me below and now I keep getting the following errors:
TCDownload.h: No such file or directory
yajl_parse.h: No such file or directory
Now, I've done a search on my system and don't have either one of them. So am I missing something? Also, I've downloaded the MGTwitterEngine code within the last couple days from gitub.
READ ME
Add libxml2.dylib in Other Frameworks. You'll find the library in:
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/usr/lib/libxml2.dylib
Add "$SDKROOT/usr/include/libxml2" as a Header Search Path in your Project Settings.
Although I've never used MGTwitterEngine, that error basically says that you are missing yajl library.
You can install it manually by doing (I assume you install to default /usr/local location):
git clone git://github.com/lloyd/yajl
cd yajl
./configure
sudo make install
Then in your xcode project:
Add libyajl.dylib or libyajl_s.a (dynamic/static - whichever you prefer, either should be located in /usr/local/lib/) to 'external frameworks and libraries' in your project tree. In project settings add "/usr/local/include/yajl/" and (possibly) "/usr/local/include/" to Header Search Paths (in Search Paths section).
After that it should build.
On mac, you can use port (See how to install here)
After install simply type in terminal :
sudo port install yajl
And like ttvd say before:
In your xcode project:
Add libyajl.dylib or libyajl_s.a (dynamic/static - whichever you prefer, either should be located in /usr/local/lib/) to 'external frameworks and libraries' in your project tree. In project settings add "/usr/local/include/yajl/" and (possibly) "/usr/local/include/" to Header Search Paths (in Search Paths section).
This works if you don't care about YAJL:
"Guys – the yajl/yajl_parse.h error is confusing and the reason the demo works is that the files that need yajl are excluded from building, even though they’re in the project. To fix in your own project go into the MGTwitter folder via xcode and select each .m file with the term yajl in it (there should be 6), right-click -> Get Info -> Targets tab and uncheck the box next to your app name. HTH, Jon"
One of the comments on http://aralbalkan.com/3133
I am just going to add something because I think it is important and I usually hacked around it in the past.
---->>
The header search paths are defined in project settings but are over-ridden in the target settings so if you are having problems including certain files check the header search paths that are set in your target settings. If they are bold then they are being used and overriding the default settings for the project.
dl and install this: http://cmake.org
before
git clone git://github.com/lloyd/yajl
cd yajl
./configure
sudo make install
then add the dylibs and you should be ok!