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 :
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