 |
 |
mySQL c API
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Sep 2000
Location: Germany
Status:
Offline
|
|
Hi!
I would like to link an object file which uses the mySQL c API in OS X, but I get the following result:
<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>
& cc -c -I/usr/local/include/mysql main.c
& cc -o myThorcli main.o -L/usr/local/lib/mysql -lmysqlclient -lm
/usr/bin/ld: Undefined symbols:
_compress
_uncompress
</font>[/code]
This should work on linux and other unices, it's from a book. I don't find a way around this problem. Any ideas?
Stefan
|
|
Phure (aka BlackMac.de)
He who knows does not talk - He who talks does not know!
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Jun 2001
Location: Dundee, Scotland
Status:
Offline
|
|
I had exactly the same problem. After a lot of banging my head againsed a wall I discovered that you need to link it to zlib.
You need to install and lizlib library - then you compile your client with:
<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>cc -o progname progname.c -L/usr/local/lib/mysql -lmysqlclient -lz </font>[/code]
There are a few places to get zlib for OSX. I'll see if I can find one for you. The best place for this kind of stuff is the darwin sites.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Jun 2001
Location: Dundee, Scotland
Status:
Offline
|
|
You'll find zlib here
http://port.mosxsw.com/port/zlib/
straight from the site:
zlib 1.1.3 binary for Mac OS X
zlib is a free compression library; it provides compression capabilities to other programs like libpng. The master zlib site is http://www.info-zip.org/pub/infozip/zlib/. zlib appears to be already present in Mac OS X PB, but libpng isn't satisfied with that version, so I built the standard version. To use my binary version, download zlib-1.1.3-macosx.tgz (don't bother uncompressing it with StuffIt), open Terminal and:
1. cd directory containing zlib-1.1.3-mosx.tgz
2. su
3. enter your root password
4. tar xzf zlib-1.1.3-mosx.tgz
5. cd zlib-1.1.3-mosx
6. ./install.sh
7. exit
The offical generic version of zlib compiles as-is under Mac OS X (if you have the software build tools). make and make install should install /usr/local/lib/libz.a and the headers.
------------------------------------------------------------------------
cheers,
sam.
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Dec 2000
Status:
Offline
|
|
Originally posted by sambeau:
<STRONG>You'll find zlib here
http://port.mosxsw.com/port/zlib/
straight from the site:
zlib 1.1.3 binary for Mac OS X
zlib is a free compression library; ...</STRONG>
Actually, zlib is already installed on Mac OS X out of the box. zlib.h is present in the Kernel framework. The Perl module Compress::Zlib uses it.
Embarrassingly enough, I don't know where the library is in the system frameworks directories. It links fine from Perl.

|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status:
Offline
|
|
Originally posted by bobDalgleish:
<STRONG>Actually, zlib is already installed on Mac OS X out of the box. zlib.h is present in the Kernel framework. The Perl module Compress::Zlib uses it.
Embarrassingly enough, I don't know where the library is in the system frameworks directories. It links fine from Perl.
 </STRONG>
It's in /usr/lib, methinks. 
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Sep 2000
Location: Germany
Status:
Offline
|
|
Thank you, you guys are really great.
|
|
Phure (aka BlackMac.de)
He who knows does not talk - He who talks does not know!
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Jun 2001
Location: Dundee, Scotland
Status:
Offline
|
|
Funny that. I can definitely remember installing zlib to get gd working at some point. Was it in the public beta?
Talking of gd has anyone managed to get freetype working with it -- I've been banging my head against another brick wall all day.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|