Re: error with 4.0.9 "c" API or user
In the last episode (Jan 25), sam said: > I am getting the following message when submitting the following: > > [sam@linux sam]$ make > > gcc -o listener main.o common.o -L/usr/lib/mysql -lmysqlclient -lm > /usr/lib/mysql/libmysqlclient.a(my_compress.o): > In function `my_uncompress': my_compress.o(.text+0xaa):undefined reference to >`uncompress' > /usr/lib/mysql/libmysqlclient.a(my_compress.o): > In function `my_compress_alloc': my_compress.o(.text+0x13c): undefined reference >to `compress' > collect2: ld returned 1 exit status make: *** [listener] Error 1 Add -lz to your link line after -lmysqlclient. Your system is apparently one where libraries cannot tell the linker what other libraries they depend on, so you have to do it yourself. -- Dan Nelson [EMAIL PROTECTED] - 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
Re: error with 4.0.9 "c" API or user
how-to-repeat: compile a c program use mysqlclient 4.0.9. Below is the makefile and output from running make Makefile: CC = gcc INCLUDES = -I/usr/include/mysql LIBS = -L/usr/lib/mysql -lmysqlclient -lm all: listener main.o: main.c common.h $(CC) -c $(INCLUDES) main.c common.o: common.c common.h $(CC) -c $(INCLUDES) common.c listener: main.o common.o $(CC) -o listener main.o common.o $(LIBS) clean: rm -f listener main.o common.o I am getting the following message when submitting the following: [sam@linux sam]$ make gcc -o listener main.o common.o -L/usr/lib/mysql -lmysqlclient -lm /usr/lib/mysql/libmysqlclient.a(my_compress.o): In function `my_uncompress': my_compress.o(.text+0xaa):undefined reference to `uncompress' /usr/lib/mysql/libmysqlclient.a(my_compress.o): In function `my_compress_alloc': my_compress.o(.text+0x13c): undefined reference to `compress' collect2: ld returned 1 exit status make: *** [listener] Error 1 Please advise sam - 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