Re: Statically link libmysqlclient.a to my Foundation tool
Re: Statically link libmysqlclient.a to my Foundation tool
- Subject: Re: Statically link libmysqlclient.a to my Foundation tool
- From: Sherm Pendley <email@hidden>
- Date: Fri, 20 Aug 2010 13:34:16 -0400
On Fri, Aug 20, 2010 at 1:26 PM, Heizer, Charles <email@hidden> wrote:
>
> I have been googling for a while now and have tried a few suggestions I
> have found in other like posts but have not had much success.
>
> I'm trying to create a stand alone Foundation tool which will connect to
> MySQL and I can get this to work if I link to the "libmysqlclient.dylib"
> library. But as others have also wanted :) I do not want the user to have
> to install the MySQL connector software.
>
> I have added the "Other linker flags" "-lmysql -lpthread -lz $(inherited)"
> and no luck, I always need the "libmysqlclient.dylib" in my DYLB path for
> it to work.
The "-l" linker flag will always prefer dynamic libraries over static.
To link with a static library when both are present, just provide the
full path to the library, without the "-l". For example:
"/usr/local/lib/mysql.a -lpthread -lz $(inherited)".
sherm--
--
Cocoa programming in Perl:
http://camelbones.sourceforge.net
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden