I solved my own problem. A simple switch in the order of the libraries
listed in the link command did the trick.
gcc -static metamgrd.o sock.o cfgfile.o cfgitem.o err.o -o ./metamgrd \
-lstdc++ -L/usr/lib/mysql -lmysqlclient -lz -lsqlplus
On Sun, 22 Apr 2001, William Dan Terry wrote:
> On Sun, 22 Apr 2001, Sinisa Milivojevic wrote:
>
> > Wm Terry writes:
> > > I seem to have a problem similar to others, but none of the suggested
> > > solutions seem to solve it. It's the standard "undefined reference to
> > > `compress'" while using MySQL++. What am I missing. Many solutions
> > > appear to address libmysqlclient. So I'm not sure if the problem is
> > > MySQL or MySQL++ oriented (though MySQL is working fine and the MySQL++
> > > examples make fine).
> > >
> > >
> > > $ make metamgrd
> > > gcc -c -g -I/usr/local/mysql metamgrd.C
> > > gcc -static metamgrd.o sock.o cfgfile.o cfgitem.o err.o -o ./metamgrd
> > > -lstdc++ -L/usr/lib/mysql -lz -lmysqlclient -lsqlplus
> > > /usr/lib/mysql/libmysqlclient.a(my_compress.o): In function
> > > `my_uncompress':
> > > my_compress.o(.text+0x97): undefined reference to `uncompress'
> > > /usr/lib/mysql/libmysqlclient.a(my_compress.o): In function
> > > `my_compress_alloc':
> > > my_compress.o(.text+0x126): undefined reference to `compress'
> > > collect2: ld returned 1 exit status
> > > make: *** [metamgrd] Error 1
> > >
> > >
> > > I've remade a MySQL++ example for grins and it works fine.
> > >
> > > # make simple1
> > > c++ -DHAVE_CONFIG_H -I. -I. -I.. -I../sqlplusint -I../sqlplusint
> > > -I/usr/local/mysql/include/mysql -g -O2 -c simple1.cc
> > > /bin/sh ../libtool --mode=link c++ -g -O2 -L/usr/local/mysql/lib/mysql
> > > -o simple1 simple1.o ../sqlplusint/libsqlplus.la -lz -lmysqlclient
> > > c++ -g -O2 -L/usr/local/mysql/lib/mysql -o .libs/simple1 simple1.o
> > > ../sqlplusint/.libs/libsqlplus.so -lz -lmysqlclient -lz -lmysqlclient
> > > -Wl,--rpath -Wl,/usr/local/lib
> > > creating simple1
> > >
> > > Running simple1 causes a core dump, but I'm guessing that has to do with
> > > not having the appropriate db and dbaccess (didn't modify the code). I
> > > figured I'd start by using modified parts of the examples in my own app
> > > and that that would be just as good a test (if I can make it).
> > >
> > >
> > > I have checked and config.h for MySQL does have HAVE_COMPRESS defined.
> > > I've rebuilt MySQL and MySQL++ from scratch (started with the MySQL RPM
> > > install when I build the system - first time I've used development stuff
> > > from an RPM, so I decided to start from scratch just to make sure).
> > >
> > >
> > > gcc version 2.96 20000731 (Red Hat Linux 7.0)
> > > Linux 2.2.16-22smp #1 SMP Tue Aug 22 16:39:21 EDT 2000 i686 unknown
> > >
> > >
> > > Help would be greatly appreciated.
> > >
> > >
> > > Thanks, William
> > >
> >
> >
> > Hi!
> >
> > First, regarding core dump, please rebuild MySQL++ with this
> > connection.cc :
> >
> > [ Part 2, Application/OCTET-STREAM 6KB. ]
> > [ Cannot display this part. Press "V" then "S" to save in a file. ]
> >
> >
> > [ Part 3: "message body text" ]
> >
> >
> >Second, downgrade to 2.95.2 as 2.96 is very buggy when it comes to
> >C++.
> >
> >Third, compress and uncompress are defined in zlib library.
> >
> >The above is a bug in your linker. Try including static zlib in a link
> >args.
>
> When you say the bug is in the linker, do you mean in the linker app
> itself or how I'm using it? In terms of the static zlib, don't I have that
> covered with
>
> gcc -static metamgrd.o sock.o cfgfile.o cfgitem.o err.o -o ./metamgrd \
> -lstdc++ -L/usr/lib/mysql -lz -lmysqlclient -lsqlplus
>
> or am I missing something else?
>
> >Regards,
> >
> >Sinisa
> >
> > ____ __ _____ _____ ___ == MySQL AB
> > /*/\*\/\*\ /*/ \*\ /*/ \*\ |*| Sinisa Milivojevic
> > /*/ /*/ /*/ \*\_ |*| |*||*| mailto:[EMAIL PROTECTED]
> > /*/ /*/ /*/\*\/*/ \*\|*| |*||*| Larnaca, Cyprus
> > /*/ /*/ /*/\*\_/*/ \*\_/*/ |*|____
> > ^^^^^^^^^^^^/*/^^^^^^^^^^^\*\^^^^^^^^^^^
> > /*/ \*\ Developers Team
> >
> >
>
> ___________W__i__l__l__i__a__m_____D__a__n_____T__e__r__r__y___________
> How do we acquire wisdom along with all these shiny things? -David Brin
>
> PGP public key: http://www.knotworks.com/wdt_pgp_pubkey.asc
> fingerprint: DC 80 E4 18 E2 CB AC F4 8C 59 9B 9C BB A2 D7 4B
> [ Part 2, Application/OCTET-STREAM 6KB. ]
> [ Cannot display this part. Press "V" then "S" to save in a file. ]
>
>
> [ Part 3: "message body text" ]
>
>
> Second, downgrade to 2.95.2 as 2.96 is very buggy when it comes to
> C++.
>
> Third, compress and uncompress are defined in zlib library.
>
> The above is a bug in your linker. Try including static zlib in a link
> args.
>
>
> Regards,
>
> Sinisa
>
> ____ __ _____ _____ ___ == MySQL AB
> /*/\*\/\*\ /*/ \*\ /*/ \*\ |*| Sinisa Milivojevic
> /*/ /*/ /*/ \*\_ |*| |*||*| mailto:[EMAIL PROTECTED]
> /*/ /*/ /*/\*\/*/ \*\|*| |*||*| Larnaca, Cyprus
> /*/ /*/ /*/\*\_/*/ \*\_/*/ |*|____
> ^^^^^^^^^^^^/*/^^^^^^^^^^^\*\^^^^^^^^^^^
> /*/ \*\ Developers Team
>
>
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
> http://www.mysql.com/manual.php (the manual)
> http://lists.mysql.com/ (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
><[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
___________W__i__l__l__i__a__m_____D__a__n_____T__e__r__r__y___________
How do we acquire wisdom along with all these shiny things? -David Brin
PGP public key: http://www.knotworks.com/wdt_pgp_pubkey.asc
fingerprint: DC 80 E4 18 E2 CB AC F4 8C 59 9B 9C BB A2 D7 4B
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php