g++ main.cpp -I"C:/Program Files/MySQL/MySQL Connector C++ 1.0.5/include" -L"C:/Program Files/MySQL/MySQL Connector C++ 1.0.5/lib/debug" -lmysqlcppconn
#include <iostream> #include "mysql_connection.h" #include "cppconn/driver.h" #include "cppconn/exception.h" #include "cppconn/resultset.h" #include "cppconn/statement.h" #include "cppconn/prepared_statement.h" using namespace std; int main(){ sql::Driver *driver; sql::Connection *con; driver=get_driver_instance(); con=driver->connect("tcp://localhost","root","root"); con->setSchema("test"); sql::Statement * stmt; stmt=con->createStatement(); sql::ResultSet * res; res=stmt->executeQuery("select * from students"); while(res->next()){ std::cout<<"label : "<<res->getString("message")<<endl; } delete res; delete stmt; delete con; return 0; }
C:/Program Files/MySQL/MySQL Connector C++ 1.0.5/include/cppconn/config.h:60:18: error: conflicting declaration 'typedef char int8_t' typedef __int8 int8_t; ^~~~~~ C:/Program Files/MySQL/MySQL Connector C++ 1.0.5/include/cppconn/config.h:75:19: error: conflicting declaration 'typedef long int int32_t' typedef __int32 int32_t; ^~~~~~~ C:/Program Files/MySQL/MySQL Connector C++ 1.0.5/include/cppconn/config.h:79:26: error: conflicting declaration 'typedef long unsigned int uint32_t' typedef unsigned __int32 uint32_t; ^~~~~~~~
MySQL
typedef
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)