我正在尝试在我的新服务器上编译我的程序,但目前它并不适合我.
错误日志是:
rasmus@web01:~/c++$make test
g++ `mysql_config --cflags --libs` main.cpp logger.cpp cpulogger.cpp -o test
/tmp/ccPaMZUy.o: In function `CPULogger':
/home/rasmus/c++/cpulogger.cpp:7: undefined reference to `mysql_init'
/home/rasmus/c++/cpulogger.cpp:8: undefined reference to `mysql_real_connect'
/home/rasmus/c++/cpulogger.cpp:10: undefined reference to `mysql_get_client_info'
/tmp/ccPaMZUy.o: In function `~CPULogger':
/home/rasmus/c++/cpulogger.cpp:16: undefined reference to `mysql_close'
collect2: ld returned 1 exit status
make: *** [all] Error 1
正如您所看到的,我正在编译MySQL – 我已经检查过包含路径中是否存在mysql.h.
我错过了什么?
cpulogger.cpp在顶部有#include“cpulogger.h”,然后cpulogger.h有这个: