我有Visual Studio 10 c ++,MySQL连接器和服务器。
我的代码是:
#include "mysql_connection.h"
#include "mysql_driver.h"
#include
#include
#include
#include
#include
void main()
{
sql::Driver *driver;
sql::Connection *con;
sql::Statement *stmt;
sql::ResultSet *res;
sql::PreparedStatement *pstmt;
con = driver->connect("localhost","root","admin12");
}如果我用调试编译给我那个错误:
Run-Time Check Failure #3 - The variable 'driver' is being used without being initialized.
如果我编译与释放给我:
Excepción no controlada en 0x003610db en MySQL.exe: 0xC0000005: Infracción de acceso al leer la ubicación 0x0fc08561.
给我一些错误
con = driver->connect("localhost","root","admin12");帮帮我?