我是 makefile 的新手,编译时出现此错误。
all: main
main.o:ssh-functions.o mysql_connector.o
g++ -c main.c ssh-functions.o mysql_connector.o -I libuv/include -L libuv/ -luv -lrt -lpthread
ssh-functions.o:ssh-functions.cpp
g++ -c ssh-functions.cpp -lssl -lcrypto
mysql_connector.o: mysql_connector.c
g++ -I/usr/include/mysql/ -c mysql_connector.c -L/usr/include/mysql/ -lmysqlclient
clean:
rm -rf *.o
输出:
g++ -c ssh-functions.cpp -lssl -lcrypto
g++ -I/usr/include/mysql/ -c mysql_connector.c -L/usr/include/mysql/ -lmysqlclient
g++ -c main.c ssh-functions.o mysql_connector.o -I libuv/include -L libuv/ -luv -lrt -lpthread
In file included from main.c:4:0:
mysql_connector.c:4:19: fatal error: mysql.h: No such file or directory
compilation terminated.
make: *** [main.o] Error 1