SQL >> Database teknologi >  >> RDS >> Mysql

Ret undefined reference to get_driver_instance i C++ MySQL Connector

Fejlen er næsten altid et link-problem.

Installer pakken:

sudo apt-get install libmysqlcppconn-dev

Kompilér med -lmysqlcppconn:

g++ -Wall -I/usr/include/cppconn -o testapp tester.cpp -L/usr/lib -lmysqlcppconn

Det sikrer, at get_driver_instance kan findes under linking.

  1. Undgå memory leaks i MySQL C++ Connector

  2. C++ MySQL-forbindelse bad_alloc med C++ connector

  3. Løs build-problemer med MySQL C++ Connector

  4. MySQL Connector for Python-argumenter