List:MySQL++« Previous MessageNext Message »
From:Willy K' Date:April 4 2005 5:13am
Subject:Compilation, Linking error for MySQL++ tutorials
View as plain text  
Dear all,
am new to MySQL++ and also Linux
I now have a problem of g++~ing resetdb.cpp provide in the
/usr/local/mysql++1.7.30/examples/

I have seen various post about it, and try it all, but still
can't get it done.

Here's what I've done

---------------------------------------------------
In file ld.so.conf

/usr/lib/mysql
/usr/local/lib
/usr/local/mysql++-1.7.30/lib
/usr/lib

AND ran "ldconfig"
---------------------------------------------------

in /usr/local/mysql++1.7.30/examples/
I've ran "./make"

---------------------------------------------------

I've tried "g++ resetdb.cpp -lmysqlpp" infinite times, this is
what it returns

-------------------------------------------------------
OUTPUT

[root@localhost examples-gcc]# g++ resetdb.cpp -lmysqlpp
/tmp/ccQjmiyQ.o(.text+0x144): In function `main':
: undefined reference to `connect_to_db(int, char**,
mysqlpp::Connection&, char const*)'
/tmp/ccQjmiyQ.o(.text+0x17c): In function `main':
: undefined reference to `kpcSampleDatabase'
/tmp/ccQjmiyQ.o(.text+0x1e6): In function `main':
: undefined reference to `kpcSampleDatabase'
/tmp/ccQjmiyQ.o(.text+0x30a): In function `main':
: undefined reference to `kpcSampleDatabase'
collect2: ld returned 1 exit status
---------------------------------------------------------

I have saw a post before having the similar problem, that user
re-make mysql++ and it worked,
Well, I sort of did that too, but after "./configure
--with-mysql=/usr/local/mysql-max-4.1.10-pc-linux-gnu-i686",
"make", "make install", but the problem still exist!!!

Please advise!!!

Willy Kwong @HK
Thread
Compilation, Linking error for MySQL++ tutorialsWilly K'4 Apr
  • Re: Compilation, Linking error for MySQL++ tutorialsWarren Young4 Apr
Re: Compilation, Linking error for MySQL++tutorialsWilly K'5 Apr
  • Re: Compilation, Linking error for MySQL++ tutorialsWarren Young5 Apr