5 messages in com.mysql.lists.plusplusRe: MySql++ and Compiling| From | Sent On | Attachments |
|---|---|---|
| Tomppa | 27 Dec 2000 05:12 | |
| Thimble Smith | 27 Dec 2000 05:16 | |
| Thimble Smith | 27 Dec 2000 06:26 | |
| Tomppa | 27 Dec 2000 06:52 | |
| Tomppa | 27 Dec 2000 08:24 |
| Subject: | Re: MySql++ and Compiling![]() |
|---|---|
| From: | Thimble Smith (ti...@mysql.com) |
| Date: | 12/27/2000 06:26:15 AM |
| List: | com.mysql.lists.plusplus |
On Wed, Dec 27, 2000 at 04:52:34PM +0200, Tomppa wrote:
My compiler use options like this:
c++ -DHAVE_CONFIG_H -I. -I. -I. -I.. -O0 -g3 -Wall - c main.cpp c++ -O0 -g3 -Wall -0 mysql main.o
To me this not say much.
OK. In that case you need to find a place to learn a bit about how the compiler works. Here's a quick example that should help you get started, though.
Change the second line to:
c++ -Wall -o example_program main.o -L/usr/local/lib -L/path/to/mysql/lib/mysql
-L/path/to/mysql++/lib -lz -lmysqlclient -lsqlplus
You will need to change those paths so they point to the correct directories. There should be a tutorial about running the compiler under Unix somewhere on the net. Maybe a Linux HOWTO....
examples of not defined:
/usr/include/g++-3/stl_vector.h(.text+0X30):undefined reference to 'Mysqlconnection::MysqlConnection(char const *,char const *,char const *,char const *,bool)' /usr/include/g++-3/stl_vector.h(.text+0X56d):undefined reference to 'operator<<(ostream &, mysql_ColData<const_string>const &)' /usr/include/g++-3/stl_vector.h(.text+0X6e1):undefined reference to 'Mysqlconnection::MysqlConnection()'
and so on......................
This is because you didn't tell the linker to use the mysqlclient and sqlplus libraries, so it didn't know where to find the definitions of those routines.
I hope this help you to help me :)
Maybe....
I see that you are not far away from my place(Espoo,Finland)
Yes, for a while I'm in Finland, learning more about MySQL and enjoying a nice hot sauna once in a while.
Tim
-- __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Tim Smith <ti...@mysql.com> / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Development Team /_/ /_/\_, /___/\___\_\___/ Helsinki, Finland (for a few weeks) <___/ www.mysql.com




