[问题]vpath不起作用

软件和网站开发以及相关技术探讨
回复
zxw
帖子: 7
注册时间: 2008-01-31 14:37

[问题]vpath不起作用

#1

帖子 zxw » 2008-02-23 23:19

makefile:
1 vpath %.h ./src
2 test: test.o print.o
3 gcc -Wall -o $@ $?
4 test.o:print.h
5 clean:
6 rm -f *.o test
在src里存放了print.c和print.h

但是编译的时候老是提示出错
cc -c -o test.o test.c
test.c:1:18: 错误: print.h:No such file or directory
make: *** [test.o] 错误 1

这是怎么回事?
回复