我正在尝试为 mysql c++ connect 运行示例程序。每次都会出错。这是我从各种解决方案中尝试的各种方法,但没有运气。
任何帮助将不胜感激!
g++ -o a temp.cpp -lmysqlcppconn // error : many error like /usr/lib/gcc/i686-linux-gnu/4.7/../../../../lib/libmysqlcppconn.so: undefined reference to `mysql_next_result@libmysqlclient_18'
g++ -o test -Iinclude -Llib -L/usr/lib64/mysql -lmysqlclient temp.cpp // error: /usr/bin/ld: cannot find -lmysqlclient
g++ -Wall -o firsttry_prog -I/usr/include/mysqlcppconn -L/usr/lib/mysqlcppconn temp.cpp -lmysqlcppconn // ERRor : kind of dozens error : /usr/lib/gcc/i686-linux-gnu/4.7/../../../../lib/libmysqlcppconn.so: undefined reference to `mysql_stmt_field_count@libmysqlclient_18'
sudo g++ -Wall -I/usr/include/cppconn -o testapp temp.cpp -L/usr/lib -lmysqlcppconn //gives dozens of error