只是我想把ImageMagick标题变成我的新手制作计划。为什么它仍然没有给我这样的文件或目录'错误?
CC=g++
CFLAGS=-c -I/usr/local/include/ImageMagick-7/
all: go
go: demo.o
g++ demo.o -o test
demo.o: demo.cpp
g++ -C demo.cpp
cleanup:
rm *.o
答案 0 :(得分:3)
您已声明了标志但未在编译步骤中包含该变量。将您的makefile更改为此
CC=g++
CFLAGS=-c -I/usr/local/include/ImageMagick-7/
all: go
go: demo.o
$(CC) demo.o -o test
demo.o: demo.cpp
$(CC) $(CFLAGS) demo.cpp
cleanup:
rm *.o
rm test