I am trying to connect to a simple database, basically to check that I have the gist of programming with MySQL.
I have tried the following code: #include <mysql/mysql.h> #include "linlog.h" LinLog::LinLog(QWidget *parent, const char *name) : PGM_Window(parent, name) { MYSQL mysql; mysql_init(&mysql); if(!mysql_real_connect(&mysql,"localhost","root","passw","database",0,NULL,0)); { fprintf(stderr,"Failed to connect to database: Error: %s\n",mysql_error(&mysql)); }; } Then try to 'make' and end up with the following errors: /home/pmoscatt/C++/linlog/linlog/linlog.cpp:9: undefined reference to `mysql_init' linlog.o(.text+0x65):/home/pmoscatt/C++/linlog/linlog/linlog.cpp:10: undefined reference to `mysql_real_connect' linlog.o(.text+0x7a):/home/pmoscatt/C++/linlog/linlog/linlog.cpp:12: undefined reference to `mysql_error' linlog.o(.text+0xd4): In function `LinLog::LinLog[in-charge](QWidget*, char const*)': /home/pmoscatt/C++/linlog/linlog/linlog.cpp:9: undefined reference to `mysql_init' linlog.o(.text+0xfd):/home/pmoscatt/C++/linlog/linlog/linlog.cpp:10: undefined reference to `mysql_real_connect' linlog.o(.text+0x112):/home/pmoscatt/C++/linlog/linlog/linlog.cpp:12: undefined reference to `mysql_error' collect2: ld returned 1 exit status gmake[2]: *** [linlog] Error 1 gmake[2]: Leaving directory `/home/pmoscatt/C++/linlog/linlog' gmake[1]: Leaving directory `/home/pmoscatt/C++/linlog' gmake[1]: *** [all-recursive] Error 1 gmake: *** [all-recursive-am] Error 2 *** failed *** I am programming using KDE. What's the GO ? Pete __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]