dbTalk Databases Forums  

BadQuery Exception what() problems

mailing.database.mysql-plusplus mailing.database.mysql-plusplus


Discuss BadQuery Exception what() problems in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Andreas Volz
 
Posts: n/a

Default BadQuery Exception what() problems - 05-01-2005 , 07:42 AM






Hi,

I could compile the examples only if I comment some lines. g++ doesn't
like the what() call. See the message from g++:

deadline.cpp: In function `int main(int, char**)':
deadline.cpp:75: error: `what' undeclared (first use this function)
deadline.cpp:75: error: (Each undeclared identifier is reported only
once for each function it appears in.)

This is the code:
....
catch (BadQuery& er) {
// Handle any connection or query errors that may come up
cerr << "Error: " << er.what() << endl;
return -1;
....

I use mysql++-1.7.26. Why does this happen? I looked into the
exception.h and there's a what() call. So I don't understand why it
doesn't work.

regards
Andreas

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw


Reply With Quote
  #2  
Old   
Chris Frey
 
Posts: n/a

Default Re: BadQuery Exception what() problems - 05-01-2005 , 01:23 PM






On Sun, May 01, 2005 at 02:13:25PM +0200, Andreas Volz wrote:
Quote:
Hi,

I could compile the examples only if I comment some lines. g++ doesn't
like the what() call. See the message from g++:
[snip]

Quote:
I use mysql++-1.7.26. Why does this happen? I looked into the
exception.h and there's a what() call. So I don't understand why it
doesn't work.
That version still had the old style mysql++ exceptions. If you want
the standard ones, you need to build with --use-exception specified on
the ./configure command line.

Or, just upgrade to 1.7.34, which uses only C++ std::exception-style
exceptions.

- Chris


--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.