简体   繁体   English

我的新手Makefile中不能包含目录

[英]Can't include a directory in my newbie Makefile

Simply I am trying to get ImageMagick headings into my newbie make scheme. 我只是试图将ImageMagick的标题纳入我的新手制作方案。 Why is it still giving me 'no such file or directory' error? 为什么仍然给我“没有这样的文件或目录”错误?

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

You have declared the flags but you have not included the variable in the compile step. 您已经声明了标志,但是尚未在编译步骤中包含变量。 Change your makefile to this 将您的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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM