From: <sinisa Date: March 21 1999 8:57pm Subject: Compiler Trouble. List-Archive: http://lists.mysql.com/mysql/736 Message-Id: <14069.23850.591053.280359@monster.local.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Thomas R. Bedell writes: > Hello All, > > This is probably pretty dumb but... > > Does anybody see a problem with the following code???? > > > /* Establish Connection to MySQL Server */ > > #include "mysql.h" > #include > #include > > MYSQL mysql; > > main() > { > mysql_init(&mysql); > > /* my prog here */ > > return 0; > } > > > When I try to comple I get... > > [trbedell@oscar c]# gcc -o connect mysql.c > /tmp/cca034371.o: In function `main': > /tmp/cca034371.o(.text+0x9): undefined reference to `mysql_init' > [trbedell@oscar c]# > > > USING: Redhat 5.1, MySQL 3_22_20a, (I have installed Bench, Client and Devel packages also) and glibc-2_0_7-19. > > > Thank you in advance. > > Tom Bedell > Hi! Simply, you have to give -L directive which will point out to a directory containing libmysqlclient.so or libmysqlclient.a . Sinisa +---------------------------------------------------------------------+ | TcX ____ __ _____ _____ ___ == mysql@stripped | | /*/\*\/\*\ /*/ \*\ /*/ \*\ |*| Sinisa Milivojevic | | /*/ /*/ /*/ \*\_ |*| |*||*| mailto:sinisa@stripped | | /*/ /*/ /*/\*\/*/ \*\|*| |*||*| Belgrade | | /*/ /*/ /*/\*\_/*/ \*\_/*/ |*|_____ Serbia | | ^^^^^^^^^^^^/*/^^^^^^^^^^^\*\^^^^^^^^^^^ | | /*/ \*\ Developers Team | +---------------------------------------------------------------------+