undefined reference to 'get_driver_instance'

前端 未结 2 472
迷失自我
迷失自我 2020-12-18 11:50

I\'m getting \"undefined reference to \'get_driver_instance\'\" when building even the most simple example from: http://dev.mysql.com/doc/refman/5.1/en/connector-cpp-example

相关标签:
2条回答
  • 2020-12-18 11:51

    try to add '-lmysqlclient' to the command, i.e.: g++ -o test -Iinclude -Llib -L/usr/lib64/mysql -lmysqlclient main.cpp

    0 讨论(0)
  • 2020-12-18 12:14

    try adding -lmysqlcppconn to your linker options. I answered just for this to have an answer (even though this was asked 2 years ago :D)

    0 讨论(0)
提交回复
热议问题