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: "Heizer, Charles" <email@hidden>
- Date: Fri, 20 Aug 2010 11:03:27 -0700
- Acceptlanguage: en-US
- Thread-topic: Statically link libmysqlclient.a to my Foundation tool
Thanks for the quick response. So I just tried this and I'm having the
same issue.
I changed my "Other linker flags" as suggested and when I try to run this
without the libmysqlclient.dylib in my path it still complains ...
/Users/local/Desktop/new/MySQLTest2
dyld: Library not loaded: libmysql.16.dylib
Referenced from: /Users/local/Desktop/new/MySQLTest2
Reason: image not found
Trace/BPT trap
Thanks,
Charles
--
Charles Heizer
Systems Management Solutions Group
Lawrence Livermore National Laboratory
P: 925-422-0197
On 8/20/10 10:34 AM, "Sherm Pendley" <email@hidden> wrote:
>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