From: Warren Young Date: June 17 2006 2:10am Subject: Re: Destructor of the Connection fails List-Archive: http://lists.mysql.com/plusplus/5735 Message-Id: <44936489.8070501@etr-usa.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 #include 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.