This is my 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
When I do make, it tells me that the header I include in my main.ccp does not exist.
#include "prototypes.hpp"
This is my project organisation :
.
├── a.out
├── include
│ └── prototypes.hpp
├── Makefile
├── src
│ └── main.cpp
└── test
And the weirdest thing is that this work when I do
g++ -o test src/main.cpp -lsfml-graphics -lsfml-window -lsfml-system -I include/
Any idea why ?
g++ -c -o src/main.o src/main.cpp src/main.cpp:2:26: fatal error: prototypes.hpp: Aucun fichier ou dossier de ce type #include "prototypes.hpp" ^ compilation terminated.– Dimitri Danilov Nov 19 '15 at 21:20