0
I’m trying to connect the Mysql for some time in the Vscode with the linux OS Mint +19, and I’m not making it after taking the following steps:
I downloaded Connector on the Mysql website: https://dev.mysql.com/downloads/connector/cpp/
with the following files:
Within the include folder has the files:
Within the folder lib64 has the files:
and put the files of include folder in -> /usr/include/
and the archives of folder lib64 put in -> /usr/lib/
The code I made in Vscode was very simple:
#include <stdlib.h>
#include <iostream>
#include <jdbc/mysql_connection.h>
#include <jdbc/mysql_driver.h>
#include <jdbc/cppconn/exception.h>
using namespace std;
using namespace sql;
int main(void)
{
sql::Driver *driver;
sql::Connection *con;
cout << "connecting to mysql server....";
driver = get_driver_instance();
con = driver->connect("tcp://127.0.0.1:3306", "leandro", "root");
cout << "connected" << endl;
delete con;
}
when I try to run the code above the following error:
/tmp/ccBhXaG2: In the "main" function: tempCodeRunnerFile.cpp:(.text+0x2f): reference not set to "get_driver_instance" collect2: error: Ld returned 1 Exit status
instead of putting a print of the code, put the same code.
– Guto Xavier
gets all fucked up the includes when I try to put the code..
– Leandro_Rivaile
I put part of the code, part of includes was not possible.
– Leandro_Rivaile
Displaying the code was just a matter of formatting.
– Guto Xavier