List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:July 30 1999 9:57pm
Subject:Linking Client Library
View as plain text  
>>>>> "Joshua" == Joshua T McKee <jtmckee@stripped> writes:

Joshua> I've been trying to compile a C program with the mySQL client library
Joshua> (libmysqlclient.a), but keep receiving the following error:

Joshua> Undefined                       first referenced
Joshua>  symbol                             in file
Joshua> mysql_real_connect                  /var/tmp/cc0YEHaB1.o
Joshua> ld: fatal: Symbol referencing errors. No output written to db

Joshua> I am compiling with the following:

Joshua> gcc -o db -L/usr/local/lib/mysql -I/usr/local/include/mysql -lmysqlclient
Joshua> -lsocket -lnsl -lm db.c

Joshua> I'm using Solaris 2.6 with gcc 2.8.1

Joshua> The libraries/header files are installed in the respective locations. Can
Joshua> anyone give me an idea what's wrong?

Joshua> Thanks...

Joshua> Josh


Move the db.c before the libraries in the link line and it should work!

Linking Client LibraryJoshua T. McKee18 Jul
  • Re: Linking Client LibraryPaul DuBois18 Jul
    • Re: Linking Client LibraryJoshua T. McKee18 Jul
      • Re: Linking Client LibrarySasha Pachev18 Jul
        • Re: Linking Client LibraryPaul DuBois18 Jul
  • Linking Client LibraryMichael Widenius31 Jul