Enviado em 30/04/2008 - 16:52h
Resolvi estudar acesso ao mysql com c++ e estou tendo problemas com a biblioteca mysql++. Ao testar os exemplos que veem junto, estou com o seguinte erro:
debian:/home/paulo/examples# g++ -I/usr/include/mysql -I/usr/include/mysql++ -o simple simple1.cpp
printdata.h:35: error: expected unqualified-id before ‘&’ token
printdata.h:35: error: expected ‘,’ or ‘...’ before ‘&’ token
printdata.h:37: error: ISO C++ forbids declaration of ‘parameter’ with no type
printdata.h:38: error: variable or field ‘print_stock_rows’ declared void
printdata.h:38: error: ‘StoreQueryResult’ is not a member of ‘mysqlpp’
printdata.h:38: error: ‘res’ was not declared in this scope
simple1.cpp: In function ‘int main(int, char**)’:
simple1.cpp:52: error: no matching function for call to ‘mysqlpp::Connection::query(const char [23])’
/usr/include/mysql++/connection.h:199: note: candidates are: mysqlpp::Query mysqlpp::Connection::query()
simple1.cpp:53: error: ‘StoreQueryResult’ is not a member of ‘mysqlpp’
simple1.cpp:53: error: expected `)' before ‘res’
simple1.cpp:55: error: ‘res’ was not declared in this scope
Instalei o mysql++ via apt-get:
libmysql++-dev
libmysql++3
libmysqlclient15-dev
tenho a pasta mysql++ em /usr/local/includes/mysql++
alguem sabe o que estou fazendo de errado?
debian:/home/paulo/examples# g++ -I/usr/include/mysql -I/usr/include/mysql++ -o simple simple1.cpp
printdata.h:35: error: expected unqualified-id before ‘&’ token
printdata.h:35: error: expected ‘,’ or ‘...’ before ‘&’ token
printdata.h:37: error: ISO C++ forbids declaration of ‘parameter’ with no type
printdata.h:38: error: variable or field ‘print_stock_rows’ declared void
printdata.h:38: error: ‘StoreQueryResult’ is not a member of ‘mysqlpp’
printdata.h:38: error: ‘res’ was not declared in this scope
simple1.cpp: In function ‘int main(int, char**)’:
simple1.cpp:52: error: no matching function for call to ‘mysqlpp::Connection::query(const char [23])’
/usr/include/mysql++/connection.h:199: note: candidates are: mysqlpp::Query mysqlpp::Connection::query()
simple1.cpp:53: error: ‘StoreQueryResult’ is not a member of ‘mysqlpp’
simple1.cpp:53: error: expected `)' before ‘res’
simple1.cpp:55: error: ‘res’ was not declared in this scope
Instalei o mysql++ via apt-get:
libmysql++-dev
libmysql++3
libmysqlclient15-dev
tenho a pasta mysql++ em /usr/local/includes/mysql++
alguem sabe o que estou fazendo de errado?