mysql++. Вопрос о BadQuery exception.
От: py  
Дата: 25.10.06 18:56
Оценка:
Подскажие, почему не компилится.
  $ cat test.cpp

#include <vector>
#include <custom.h>
#include "mysql++.h"

int main (int argc, char * argv[])
{
   try {

   }
   catch (const mysqlpp::BadQuery& er) {
         er.what();
   }

   return 1;
}

  $ g++ -c -pipe -O2 -I/usr/include/mysql++ -I/usr/include/mysql -Wall 
-o test.o test.cpp
test.cpp: In function `int main(int, char**)':
test.cpp:12: error: `what' undeclared (first use this function)
test.cpp:12: error: (Each undeclared identifier is reported only once 
for each
    function it appears in.)


# less /usr/include/mysql++/exceptions.h
....
//: Exception thrown when a BadQuery is encountered
class BadQuery : public std::exception {
public:
   BadQuery(const std::string &er = "") : error(er) {}
   ~BadQuery() throw () {}
   const std::string error; //: The error message
   virtual const char* what( void ) const throw () { return 
error.c_str(); }
};
...
Posted via RSDN NNTP Server 2.0
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.