views:

102

answers:

2

I am trying to install the mysql++ in Code::Blocks, but When I try to run the example code I get this error:

undefined reference to __imp___ZN7mysqlpp10ConnectionC1Eb

What I am doing wrong?

A: 

You probably have a linker issue. It could well be that a DLL you need isn't present, or mysql++ was compiled but not correctly linked.

PP
+1  A: 

You must build MySQL++ with the exact same compiler and compiler options as you're using to build your program. What you're seeing is a name mangling and/or ABI mismatch due to mixing compilers and/or build options. This can be anything from a drastic error like trying to use a Visual C++ DLL with MinGW, to something more subtle like trying to use a MinGW DLL built with g++ 3.4.5 in a program you're building with MinGW g++ 4.4.

Unlike C, C++ doesn't try to preserve binary compatibility between greatly different compilers.

Warren Young
I'll try to compile it by myself
M28
Sorry, I don't know how to compile by myself :(
M28
Read README-MinGW.txt.
Warren Young