mazah_82@stripped wrote:
>
> It crashes in the line "con.close()". GDB tells me the following story:
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x00000039d1068b85 in free () from /lib64/tls/libc.so.6
You're going to have to debug it more deeply than that to tell anyone
something useful. At the very least, we need a backtrace.
Try this modified program instead:
#include <mysql++.h>
#include <iostream>
using namespace std;
using namespace mysqlpp;
int
main(int argc, char *argv[])
{
try {
Connection con(use_exceptions);
con.connect("db", "localhost", "user, "pass");
if (!con.connected()) {
cout << "Can't connect!" << endl;
return 1;
}
cout << "Closing connection.." << endl;
con.close();
cout << "Exiting.." << endl;
}
catch (exception& e) {
cout << "Exception caught: " << e.what() << endl;
}
return 0;
}
Notice how it catches exceptions. Your symptom could just be caused by
an uncaught exception.