I am writing a makefile for my program (that is tested and works) With files A.h/.cpp B.h/.cpp C.h/.cpp and my main.cpp. The problem I can tell is that some how my '-std=c++11' is not running in the function. The code pops out a unrecognized error that I dont get when I simply run 'g++ -o exe -std=c++11 *.cpp'. Here is my make file.
HEADERS = A.h B.h C.h
OBJECTS = A.o B.o C.o main.o
exe: $(OBJECTS)
g++ -std=c++11 $^ -o $@
%.o: %.cpp $(HEADERS)
g++ -c -std=c++11 $< -o $@
clean:
rm -i *.o exe
I am brand new to makefiles so I could be something very dumb.
Thank you.
Aucun commentaire:
Enregistrer un commentaire