I am writing a C++ program in Visual Studio 2019 that connects to a local MySql Database using C++ MySql connector. I am using the example code provided on the MySQL website.
sql::Driver* driver;
sql::Connection* con;
sql::Statement* stmt;
sql::ResultSet* res;
driver = get_driver_instance();
con = driver->connect("localhost", "root", "password");
con->setAutoCommit(0);
con->setSchema("testdatabase");
stmt = con->createStatement();
res = stmt->executeQuery("SELECT TestCode FROM testdatabase.test;");
delete res;
delete stmt;
delete con;
However I keep getting the same errors, no matter what I try:
I'm pretty sure it's related to this line of code, as removing it gets rid of the error
driver = get_driver_instance();
Does anyone know what causes this? I have been searching for an answer for hours and can't seem to find a fix