Mailing List
Home
Forum Home
MySQL General - General MySQL discussion
MySQL++ - Programming with the C++ API to MySQL
MaxDB - Everything about MaxDB, formerly known as SAP DB
ODBC - ODBC with the MySQL Connector/ODBC driver
MySQL on Win32 - Runing MySQL on Windows 9x/Me/NT/2000/XP
Java Help - Mostly related to the MySQL Connector/J driver
Perl - Perl support for MySQL with DBI and DBD::mysql
GUI - MySQL GUI Tools
Announcement
Subjects
mysql openssl Question
ERROR 1045: Access denied for user: 'root@localhost ' (Using
password: NO)
Update one field with more fields from another table
Getting Identity after INSERT
ERROR 2002: Can 't connect to local MySQL server through socket
mysql test 4 1 fails with the gis test
MySQL Cluster Software
Downgrade Mysql from 4 to 3 23
Mysql 4 0 Oracle Stored Procedure Trigger Conversion
Can 't access mysql after kernel upgrade
Executing MySQL Commands From Within C Program
Comparing and writing out BLOBS
Preventing Duplicate Entries
FULLTEXT query format question
Strange behavior, Table Level Permission
Does the binary log enabling affect the MySQL performances?
mysql:it 's a db not a dbms how it 's possible?!
mysql have same function mthod as Oracle decode()
 
how to compile and link

how to compile and link

2007-07-04       - By Albert Sanchez

 Back
Reply:     1     2     3  

Hello,

I'm new to MySQL++

I've just installed mysql++-2.3.0 in an Ubuntu Linux following the
instructions in README.linux

I want to compile an example but I must be missing something... it doesn't
work:

I have tried thinks like


g++ -I/LWGW/mysql/lib -I/usr/include/mysql/ -L /usr/lib/mysql
-lmysqlclient_r simple1.cpp


And the answer is:

/tmp/cc4wpKdP.o: In function `main':
simple1.cpp:(.text+0xaf): undefined reference to
`mysqlpp::Connection::Connectio
n(bool)'
simple1.cpp:(.text+0xd5): undefined reference to `connect_to_db(int, char**,
mys
qlpp::Connection&, char const*)'
simple1.cpp:(.text+0x103): undefined reference to
`mysqlpp::Connection::query()'

simple1.cpp:(.text+0x1ae): undefined reference to `mysqlpp::Row::at(unsigned
int
) const'
simple1.cpp:(.text+0x1d9): undefined reference to
`mysqlpp::operator<<(std::basi
c_ostream<char, std::char_traits<char> >&,
mysqlpp::ColData_Tmpl<mysqlpp::const_
string> const&)'
simple1.cpp:(.text+0x27e): undefined reference to `mysqlpp::Row::~Row()'
simple1.cpp:(.text+0x29a): undefined reference to `mysqlpp::Row::~Row()'
simple1.cpp:(.text+0x2bd): undefined reference to `mysqlpp::Row::~Row()'
simple1.cpp:(.text+0x2d9): undefined reference to `mysqlpp::Row::~Row()'
simple1.cpp:(.text+0x30b): undefined reference to `mysqlpp::Query::error()'
simple1.cpp:(.text+0x400): undefined reference to
`mysqlpp::Connection::~Connect
ion()'
simple1.cpp:(.text+0x422): undefined reference to
`mysqlpp::Connection::~Connect
ion()'

etc...

Can you help me please?

Thanks in advance

Albert