Hello guys. Been working this for some time now, but I'm getting more and more confused.
When I use the MingW compiler on Windows, to compile my program:
Using the following command:Code:#include <iostream> #include <mysql_connection.h> #include <mysql_driver.h> using namespace std; int main(){ 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 << "connection OK"; cin.get(); delete con; }
I get the following error:Code:g++ hw.cpp -o hw.exe
I did a few attempts on how to link a libary, but it didn't work.Code:C:\Users\kk\AppData\Local\Temp\ccRrhIs3.o:hw.cpp:(.text+0x7): undefined referen ce to `_imp___ZN3sql5mysql19get_driver_instanceEv' collect2: ld returned 1 exit status
- realchamp.




Reply With Quote