Re: using mysql.h... linking problem
Re: using mysql.h... linking problem
- Subject: Re: using mysql.h... linking problem
- From: "Mark McCray" <email@hidden>
- Date: Mon, 11 Feb 2008 01:00:39 -0500
Yep, Dragging the /usr/local/mysql/lib/mysql directory into resources solved
my issue.
But then I was getting this error:
*Undefined symbols:*
* "_compress", referenced from:*
* _my_compress_alloc in libmysqlclient.a(my_compress.o)*
* _my_compress in libmysqlclient.a(my_compress.o)*
* "_uncompress", referenced from:*
* _my_uncompress in libmysqlclient.a(my_compress.o)*
*ld: symbol(s) not found*
*collect2: ld returned 1 exit status*
Then i saw this post:
http://snort.org/docs/snortdb/snortdb_faq.html#faq_c1
Basically adding "-lz" in the additional link flags fixed that issue.
Thanks andrew!
On Feb 11, 2008 12:21 AM, Andrew Farmer <email@hidden> wrote:
> On 10 Feb 08, at 21:13, Mark McCray wrote:
> > Hi there,I'm trying to use the mysql client in my cocoa app. (I'm
> > very new
> > to using 3rd party api's within xcode.)
> >
> > In my simple app, i've included the "mysql.h" file. And in the project
> > settings I've specified in the "Build" area that the 'Header Search
> > Paths'
> > should use /usr/local/mysql recursively.
> >
> > My problem is that when I go to build my app I get a lot of linking
> > errors.
> ...
> > Do i have to create a build phase that brings over any of the mysql
> > stuff?
> > Or what else is involved when you're importing 3rd party header files?
>
> Headers are only half of the story. You also need to link against the
> MySQL client library. Keep in mind that, if you plan to distribute
> your program, you'll need to either release it under the GPL (or a
> similar license) or negotiate a license with MySQL AB. For more
> information, see [1].
>
> To link against the client libraries, just add them to your project.
> They're in /usr/local/mysql/lib on most MySQL installs.
>
> [1]: http://www.mysql.com/company/legal/licensing/faq.html
>
_______________________________________________
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