使用makefile出现如下问题时make: *** No rule to make target 'testphy/testphy.c', needed by 'testphy/testphy.o'. Stop.
分析:
此错误信息一般出现在规则的目标找不到对应的依赖所导致的,所以首先就查看相应规则的目标和依赖,是否都存在。
解决方法:
查看malefile中发现将相应的.cpp文件写成了.c。
如下:$(C_OBJS):%.o:%.c
$(CC) -o $@ -c $< $(INCLUDES)
然而原本是.cpp文件的,将上面的.c 改为.cpp就可以了。