0
這是我的Makefile:我的生成文件找不到我的頭目錄
NAME = pong
SRCS = src/main.cpp
OBJS = $(SRCS:.cpp=.o)
CFLAGS += -lsfml-graphics -lsfml-window -lsfml-system -I include/
all: $(NAME)
$(NAME): $(OBJS)
g++ -o $(NAME) $(SRCS) $(CFLAGS)
clean:
rm -f $(OBJS)
fclean: clean
rm -f $(NAME)
re: fclean all
.PHONY: all clean fclean re
當我做make
,它告訴我,在我的main.ccp頭包括我不存在。
#include "prototypes.hpp"
這是我的項目組織:
.
├── a.out
├── include
│ └── prototypes.hpp
├── Makefile
├── src
│ └── main.cpp
└── test
,而最古怪的是,這個工作時,我做
g++ -o test src/main.cpp -lsfml-graphics -lsfml-window -lsfml-system -I include/
任何想法,爲什麼?
確實告訴你,還是g ++? –
這是g ++。 'g ++ -c -o src/main.o src/main.cpp src/main.cpp:2:26:致命錯誤:prototypes.hpp:Aucun fichier或者dossier de ce類型 #include「prototypes.hpp」 已編譯終止^ 。 ' –