List:General Discussion« Previous MessageNext Message »
From:rm Date:September 8 2002 3:33am
Subject:Can't link with C API
View as plain text  
Steve, 

in this line:
 MYSQLLIBS = -L /work/doctools/mysql-3.23.52/lib -lmysqlclient 

Try eliminating the space between -L and  /work/....
that format always works for me using gcc.

Other than that, I don't see anything that looks wrong.

regis


> From: Steve Cogorno <cogorno@stripped>
> To: mysql@stripped
> Subject: Can't link with C API
> Date: 06 Sep 2002 21:19:04 -0700
> 
> >Description:
> 	I must be missing something terribly obvious, but I cannot get
> 	my client program to link. I get messages like this:
> 		ild: (undefined symbol) mysql_free_result -- referenced in the text
segment of dbinterface.o
> 	
> 	The reference manual says to make sure the -lmysqlclient and -L
> 	<path> settings are provided to the linker, which they are.  I've
> 	moved these around. I've tried setting the compile to static instead
> 	of dynamic link.  None of these seems to help.
> 	
> 	I'm using the SUNWspro/CC compiler.  I've tried switching to gcc,
> 	but I get the same result.
> 	
> 	I know that the linkers is finding the MySQL libraries because I can
> 	see the libmysqlclient.a file being opened when I trace the process
> 	with truss.  
> 	
> 	I appreciate any advice you can provide!
> 	
> 	Here's the make file:
> 
> CC	 = cc
> 
> CFLAGS	 = -Dsvr4 -g 
> 
> MYSQLFLAGS =  -I /work/doctools/mysql/include
> MYSQLLIBS = -L /work/doctools/mysql-3.23.52/lib -lmysqlclient 
> 
> INCFLAGS = -I /usr/local/include 
> 
> 
> all: TEST
> 
> clean: 
> 	rm *o TEST
> 
> TEST: dbinterface.o TEST.o
> 	$(CC) $(CFLAGS) $(INCFLAGS) $(MYSQLLIBS) dbinterface.o TEST.o  -o
TEST
> 
> TEST.o: TEST.c
> 	$(CC) $(CFLAGS) $(INCFLAGS) $(MYSQLFLAGS) -c TEST.c -o TEST.o
> 
> dbinterface.o: dbinterface.c
> 	$(CC) $(CFLAGS) $(INCFLAGS) $(MYSQLFLAGS) -c dbinterface.c  -o
dbinterface.o
> 	9
> 
> 
> >How-To-Repeat:
> 	
> >Fix:
> 	
> From: Steve Cogorno <cogorno@stripped>
> To: mysql@stripped
> Subject: Can't link with C API
> Date: 06 Sep 2002 21:19:04 -0700
> 
> >Description:
> 	I must be missing something terribly obvious, but I cannot get
> 	my client program to link. I get messages like this:
> 		ild: (undefined symbol) mysql_free_result -- referenced in the text
segment of dbinterface.o
> 	
> 	The reference manual says to make sure the -lmysqlclient and -L
> 	<path> settings are provided to the linker, which they are.  I've
> 	moved these around. I've tried setting the compile to static instead
> 	of dynamic link.  None of these seems to help.
> 	
> 	I'm using the SUNWspro/CC compiler.  I've tried switching to gcc,
> 	but I get the same result.
> 	
> 	I know that the linkers is finding the MySQL libraries because I can
> 	see the libmysqlclient.a file being opened when I trace the process
> 	with truss.  
> 	
> 	I appreciate any advice you can provide!
> 	
> 	Here's the make file:
> 
> CC	 = cc
> 
> CFLAGS	 = -Dsvr4 -g 
> 
> MYSQLFLAGS =  -I /work/doctools/mysql/include
> MYSQLLIBS = -L /work/doctools/mysql-3.23.52/lib -lmysqlclient 
> 
> INCFLAGS = -I /usr/local/include 
> 
> 
> all: TEST
> 
> clean: 
> 	rm *o TEST
> 
> TEST: dbinterface.o TEST.o
> 	$(CC) $(CFLAGS) $(INCFLAGS) $(MYSQLLIBS) dbinterface.o TEST.o  -o
TEST
> 
> TEST.o: TEST.c
> 	$(CC) $(CFLAGS) $(INCFLAGS) $(MYSQLFLAGS) -c TEST.c -o TEST.o
> 
> dbinterface.o: dbinterface.c
> 	$(CC) $(CFLAGS) $(INCFLAGS) $(MYSQLFLAGS) -c dbinterface.c  -o
dbinterface.o
> 	9
> 
> 
> >How-To-Repeat:
> 	
> >Fix:
> 	> From: Steve Cogorno <cogorno@stripped>
> To: mysql@stripped
> Subject: Can't link with C API
> Date: 06 Sep 2002 21:19:04 -0700
> 
> >Description:
> 	I must be missing something terribly obvious, but I cannot get
> 	my client program to link. I get messages like this:
> 		ild: (undefined symbol) mysql_free_result -- referenced in the text
segment of dbinterface.o
> 	
> 	The reference manual says to make sure the -lmysqlclient and -L
> 	<path> settings are provided to the linker, which they are.  I've
> 	moved these around. I've tried setting the compile to static instead
> 	of dynamic link.  None of these seems to help.
> 	
> 	I'm using the SUNWspro/CC compiler.  I've tried switching to gcc,
> 	but I get the same result.
> 	
> 	I know that the linkers is finding the MySQL libraries because I can
> 	see the libmysqlclient.a file being opened when I trace the process
> 	with truss.  
> 	
> 	I appreciate any advice you can provide!
> 	
> 	Here's the make file:
> 
> CC	 = cc
> 
> CFLAGS	 = -Dsvr4 -g 
> 
> MYSQLFLAGS =  -I /work/doctools/mysql/include
> MYSQLLIBS = -L /work/doctools/mysql-3.23.52/lib -lmysqlclient 
> 
> INCFLAGS = -I /usr/local/include 
> 
> 
> all: TEST
> 
> clean: 
> 	rm *o TEST
> 
> TEST: dbinterface.o TEST.o
> 	$(CC) $(CFLAGS) $(INCFLAGS) $(MYSQLLIBS) dbinterface.o TEST.o  -o
TEST
> 
> TEST.o: TEST.c
> 	$(CC) $(CFLAGS) $(INCFLAGS) $(MYSQLFLAGS) -c TEST.c -o TEST.o
> 
> dbinterface.o: dbinterface.c
> 	$(CC) $(CFLAGS) $(INCFLAGS) $(MYSQLFLAGS) -c dbinterface.c  -o
dbinterface.o
> 	9
> 
> 
> >How-To-Repeat:
> 	
> >Fix:
> 	

> From: Steve Cogorno <cogorno@stripped>
> To: mysql@stripped
> Subject: Can't link with C API
> Date: 06 Sep 2002 21:19:04 -0700
> 
> >Description:
> 	I must be missing something terribly obvious, but I cannot get
> 	my client program to link. I get messages like this:
> 		ild: (undefined symbol) mysql_free_result -- referenced in the text
segment of dbinterface.o
> 	
> 	The reference manual says to make sure the -lmysqlclient and -L
> 	<path> settings are provided to the linker, which they are.  I've
> 	moved these around. I've tried setting the compile to static instead
> 	of dynamic link.  None of these seems to help.
> 	
> 	I'm using the SUNWspro/CC compiler.  I've tried switching to gcc,
> 	but I get the same result.
> 	
> 	I know that the linkers is finding the MySQL libraries because I can
> 	see the libmysqlclient.a file being opened when I trace the process
> 	with truss.  
> 	
> 	I appreciate any advice you can provide!
> 	
> 	Here's the make file:
> 
> CC	 = cc
> 
> CFLAGS	 = -Dsvr4 -g 
> 
> MYSQLFLAGS =  -I /work/doctools/mysql/include
> MYSQLLIBS = -L /work/doctools/mysql-3.23.52/lib -lmysqlclient 
> 
> INCFLAGS = -I /usr/local/include 
> 
> 
> all: TEST
> 
> clean: 
> 	rm *o TEST
> 
> TEST: dbinterface.o TEST.o
> 	$(CC) $(CFLAGS) $(INCFLAGS) $(MYSQLLIBS) dbinterface.o TEST.o  -o
TEST
> 
> TEST.o: TEST.c
> 	$(CC) $(CFLAGS) $(INCFLAGS) $(MYSQLFLAGS) -c TEST.c -o TEST.o
> 
> dbinterface.o: dbinterface.c
> 	$(CC) $(CFLAGS) $(INCFLAGS) $(MYSQLFLAGS) -c dbinterface.c  -o
dbinterface.o
> 	9
> 
> 
> >How-To-Repeat:
> 	
> >Fix:
> 	



Thread
Can't link with C APIrm8 Sep
  • Re: Can't link with C APISteve Cogorno9 Sep