From: Warren Young Date: November 15 2004 1:27pm Subject: Re: Getting a segfaul List-Archive: http://lists.mysql.com/plusplus/3644 Message-Id: <4198AECE.5060909@etr-usa.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Dovid Kopel wrote: > #include "mysql.h" That isn't necessary. It's included indirectly by mysql++.h. > using namespace std; You might as well say 'using namespace mysqlpp' here as well. > mysqlpp::Query query = con.query(); > query << "select * from cars"; > cout << "Query: " << query.preview() << endl; > mysqlpp::Result res = query.store(); Try use() here instead of store(), and put the result in a ResUse object. > catch (mysqlpp::BadQuery er) You can catch this one by const reference, which is more efficient, and may stop the crash. > Query: select * from cars > Error: > Segmentation fault Clearly a segfault is happening. It would be nice if trying to dump the error didn't cause it, but you ought to check things like passwords, table names, etc. I think you're not connecting to your database correctly, or using it correctly.