Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.dylib linked in Debug, not found for Release for iPhone in XCode

Tags:

xcode

iphone

So I have included the libxml2.2.dylib library into my iPhone XCode project to create some Xml and XPath parsing utilities. When I compile and run in Debug mode for both the Simulator and Device I have no problems, however, When I switch to Release mode I get...

"error: libxml/tree.h: No such File or directory" as well as other similar errors for the following .h files.

#import <libxml/tree.h>
#import <libxml/parser.h>
#import <libxml/HTMLparser.h>
#import <libxml/xpath.h>
#import <libxml/xpathInternals.h>

What do I need to do to ensure the libary is included and linked to the Release build?

like image 484
JWD Avatar asked Jul 16 '09 21:07

JWD


2 Answers

An error on the .h is a compile-time error with your Header Search Paths, not a .dylib or a linker error.

You have to ensure that ${SDK_DIR}/usr/include/libxml2 is in your Header Search Paths in your Release configuration.

like image 66
cdespinosa Avatar answered Nov 07 '22 12:11

cdespinosa


i was going around in circles this morning with this same problem with xcode 4.

again as described exactly above, it builds with fine with Schema > Build Configuration --> Debug
but fails when switching it to Release

tried numerous cleans and adding ${SDK_DIR}/usr/include/libxml2 or $/usr/include/libxml2 and triple checking Header Search Paths / checking the recursive check box all to no avail. Was about to start a new project when ....

I managed to resolve it by adding
${SDK_DIR}/usr/include/libxml2 to the User Header Search Paths

like image 30
johndpope Avatar answered Nov 07 '22 12:11

johndpope