What library to import for #import <libxml/HTMLparser.h> - iphone

I have imported ASIHTTP files into my project and inside ASIWebPageRequest.m there is the following import:
#import <libxml/HTMLparser.h>
which is not recognized. What library should I add in order to be recognized?

Go to the Project build settings (Project->Edit Project Settings->Build) and find the "Search Paths". In "Header Search Paths" add the following path:
$(SDKROOT)/usr/include/libxml2
Note, you may be missing all development headers after upgrading OS X (at least this was the case for me with Mavericks). To reinstall the command line tools run:
xcode-select --install

With xcode 4.5, it doesn't work. I try with
/usr/include/libxml2
and it works well

putting ${SDK_DIR}/usr/include/libxml2 for the "Header Search Paths" build setting worked for me.
*Info: I'm using xcode 5

Related

<CocoaLumberjack/CocoaLumberjack.h> file not found in bridging file

I have a workspace with multiple targets and mixed development with SWIFT and Objective-C. After installing CocoaLumberjack with CocoaPods:
pod 'CocoaLumberjack/Swift'
I can use it my project without any problems. All my targets get compiled except Test target. When I run tests I get "build failed" error within the bridging header file
<CocoaLumberjack/CocoaLumberjack.h> file not found
at:
#import <CocoaLumberjack/CocoaLumberjack.h>
Do you have any ideas how to fix the issue? Thanks!

How to use FMDB with cocoapods and swift?

It looks like cocoapods supports FMDB:
pod 'FMDB/FTS'
But even after creating a bridging header I get the following error:
cocoapods bridging header error: 'FMDB.h' file not found
What's up?
Turns out I also needed to add a header search path.
In your target's settings (not project settings) navigate to Build Settings -> Header Search Paths and add the following non-recursive path:
"${PODS_ROOT}/FMDB/src/fmdb"

Can't build command line project with SQLite.swift

I'm trying to build a command-line tool which uses sqlite. I have downloaded Stephen Celis' swift wrapper, SQLite.swift, and built a working OS X app. However, I am not able to build my command-line tool. I believe that I correctly followed the instructions to do so in the SQLite.swift Documentation for frameworkless targets, but apparently I am missing something. I get an error in Helper.swift # import CSQLite -> No such module 'CSQLite'.
I am linking against libsqlite3.dylib (also tried libsqlite3.tbd)
I added the SQLite.swift source to my project
I added #import sqlite3.h & #import "SQLite-Bridging.h" to my bridging header file. Perhaps of note, when I right-click on sqlite3.h or SQLite-Bridging.h, xCode does not know where/what they are.
I'm happy to send my test project (about 80KB, compressed) to anyone who can and is willing to help. There is probably a very simple solution, I just do not see what it is.
thx for any help,
-Craig
I've faced the same problem.
There were lots of compiler errors like "Connection.swift:26:8: Could not build Objective-C module 'CSQLite'"
The error has roots to the "lctx.h:13:25: Use of undeclared identifier 'SYS_getlcid'"
It worth mentioning that I have two Xcodes installed - v 6.2 at /Applications and v 7.3 at ~/Applications. My project is iOS app on Swift with SQLite pod and I open it with the Xcode 7.3.
The SQLite pod has a file at project_folder/Pods/SQLite.swift/CocoaPods/iphonesimulator/module.modulemap.
The file had the content
module CSQLite [system] {
header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/sqlite3.h"
export *
}
To fix compiler errors I changed the content of module.modulemap to
module CSQLite [system] {
header "/Users/my_user_name/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/sqlite3.h"
export *
}
The change is that I pointed search of sqlite3.h into my ~/Applications folder where Xcode 7.3 is located.
This made my project compiling.

cannot build objective-c module 'FBSDKCoreKit'

Cant import FBSDKLoginKit to my Project (i am using cocoapods with swift)
Solution tried:
remove use_framework! from podfile
added $(PODS_ROOT) path to user header search paths
try to import in Bridging Header file (FBSDKCoreKit.h,FBSDKLoginKit.h,FBSDKShareKit.h)
Showing Error:
My Podfile:
You should also add the FBSDKCoreKit.Framework from Facebook.
Adding only the FBSDKLoginKit will give you this error.
Go through the below steps and your problem will be solved:
Tap on "Pods.xcodeproj" in your project
Select all the pods / any of one in which you are facing the issue.
Tap on "Build Settings" and change "Build Active Architecture Only" to "NO"
Now try to build to build the project and your problem will be solved.
Hope this helps!

iPhone libxml2 not found during build

I currently got some errors with libxml2 in my iPhone project. This was working before, after making some changes in my build properties building failed. (libxml2.dylib is added in the build phases)
#import <libxml/tree.h>
#import <libxml/parser.h>
#import <libxml/xmlstring.h>
#import <libxml/xpath.h>
#import <libxml/xpathInternals.h>
I've added the following items to the Build Settings:
Other Linker Flags: -lxml2
Header Search Paths: /usr/include/libxml2
I've tried adding them to the project and targets (at the same time, and switching between them) without any difference.
I also tried adding the following to the Header Search Path:
${SDKROOT}
${SDK_DIR}
Both with no result.
Building fails for:
iPhone device
iPhone and iPad emulator
Anyone have an idea?
I'm using the GData Objective-C client library: http://code.google.com/p/gdata-objectivec-client/
I'm compiling the source files directly into my project and followed all the steps that are given in the wiki. When manually importing the libxml headers again, XCode suggests the following:
#import <libxml2/libxml/tree.h>
Which doesn't work either.
Add ${SDKROOT}/usr/include/libxml2 as a header search path instead of only ${SDKROOT}.
Watch out that you all build targets that need libxml get the extra search path. If you add the path to your project's build settings, all its targets will inherit it and there shouldn't be a problem.
Add libxml2.dylib in Build Phases.
Add TFHpple.m, TFHppleElement.m, XpathQuery.m to Build Phases (Compile Sources).
Add Other Linker Flags: -lxml2 Header Search Paths: ${SDK_DIR}/usr/include/libxml2
in PROJECT --> Build Phases and in TARGETS --> Build Phases.