Witam wszystkich.
Mam problem z połączeniem się z bazą danych w języku c++ z użyciem visual studio.
Mam:
- 64 bitowy system
Ale używam: - 32 bitowego connectora
- 32 bitowego serwera MySQL
Wszystko ładnie mi się zalinkowało itd ale przy uruchomieniu jest następujący błąd:
Microsoft Visual Studio C Runtime Library has detected a fatal error in WWWMon.exe.
Press Break to debug the program or Continue to terminate the program.
Mój kod:
#include<iostream>
#include<pcap.h>
#include "mysql_connection.h"
#include "mysql_driver.h"
#include <cppconn/driver.h>
#include <cppconn/exception.h>
#include <cppconn/resultset.h>
#include <cppconn/statement.h>
using namespace std;
int main() {
cout << "Running 'SELECT 'Hello World!' AS _message'..." << endl;
sql::mysql::MySQL_Driver *driver;
sql::Connection *con;
driver = sql::mysql::get_mysql_driver_instance();
con = driver->connect("tcp://127.0.0.1:3306", "root", "");
cout << endl << endl;
system("PAUSE");
}
linijka która się wywala:
con = driver->connect("tcp://127.0.0.1:3306", "root", "");
Szczerze mówiąc sam nie wiem gdzie może leżeć błąd. Nie wiem nawet jak szukać jego przyczyny. Przypuszczam, że coś z biblioteką libmysql.dll. Ale wersja raczej pasuje, bo też jest 32 bitowa. Proszę o rady...