Problem Static Linking in XCode
Problem Static Linking in XCode
- Subject: Problem Static Linking in XCode
- From: Matthew Miller <email@hidden>
- Date: Thu, 23 Feb 2006 21:44:54 -0500
I have been trying to create a framework using XCode that effectively
wraps the basic MySQL C-API functions in an Objective-C environment.
I know there are publicly available resources that do the same but I
had reasons for completing this myself.
I have managed to get a basic framework built in XCode 2.2 (iBook G4,
Tiger 10.4.4) that compiles and works in Debug mode. But when I
attempt a build under Release, I break down in the linking. Here is
my log:
Building target “MMSQLKit” of project “MMSQLKit”
Checking Dependencies
Ld /Users/mattmiller71/Documents/Development/Objective-C/MMSQLKit/
build/MMSQLKit.build/Release/MMSQLKit.build/Objects-normal/i386/
MMSQLKit normal i386
cd /Users/mattmiller71/Documents/Development/Objective-C/MMSQLKit
/usr/bin/gcc-4.0 -o /Users/mattmiller71/Documents/Development/
Objective-C/MMSQLKit/build/MMSQLKit.build/Release/MMSQLKit.build/
Objects-normal/i386/MMSQLKit -L/Users/mattmiller71/Documents/
Development/Objective-C/MMSQLKit/build/Release -L/usr/local/lib -L/
Users/mattmiller71/Documents/Development/Objective-C/MMSQLKit -L/usr/
local/mysql-standard-5.0.18-osx10.4-powerpc/lib -F/Users/mattmiller71/
Documents/Development/Objective-C/MMSQLKit/build/Release -filelist /
Users/mattmiller71/Documents/Development/Objective-C/MMSQLKit/build/
MMSQLKit.build/Release/MMSQLKit.build/Objects-normal/i386/
MMSQLKit.LinkFileList -framework Cocoa -lmysqlclient -arch i386 -Wl,-
single_module -compatibility_version 1 -current_version 1 -
install_name @executable_path/../Frameworks/MMSQLKit.framework/
Versions/A/MMSQLKit -dynamiclib -lmysqlclient -lz -isysroot /
Developer/SDKs/MacOSX10.4u.sdk
ld: Undefined symbols:
_mysql_affected_rows
_mysql_close
_mysql_errno
_mysql_error
_mysql_fetch_field
_mysql_fetch_lengths
_mysql_fetch_row
_mysql_free_result
_mysql_init
_mysql_num_fields
_mysql_options
_mysql_query
_mysql_real_connect
_mysql_store_result
/usr/bin/libtool: internal link edit command failed
I've never been one to get into the guts of a makefile and I've
usually had the luxury of an IDE to take the pain out of building my
projects.
MySQL provides only libraries that can be linked statically (I
believe). The installation places these in the /usr/local/mysql/lib
directory. The library in question is: libmysqlclient.a.
I've set up a symbolic link to /usr/local/mysql/lib/libmysqlclient.a
in /usr/local/lib and added /usr/local/lib to my Library Path in
project settings. But now I'm stuck. I could live with just using
the Debug Configuration but that just seems wrong (and I couldn't use
it, say, on another computer).
Has anyone faced this particular problem or can anyone figure out
what I'm doing wrong? Please let me know if I need to provide more
information about the environment, etc.
Thanks in advance.
Matt
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden