I copy-pasted the Makefile content but when running make I was getting the error "mising separator. Stop". I fixed adding a tab instead of spaces in lines 15, 16, 19 and 22:
run: clean all [tab]clear [tab]./$(BIN)/$(EXECUTABLE)
$(BIN)/$(EXECUTABLE): $(SRC)/*.cpp [tab]$(CXX) $(CXX_FLAGS) -I$(INCLUDE) $^ -o $@ $(LIBRARIES)
clean: [tab]-rm $(BIN)/*
Note: It woud be nice if the main.cpp file could be put in the root of the project folder, outside of src.
Great post by the way. I spent hours trying to compile in VS Code a multi file project before I seeing this. Thanks!.
I'm glad you found a work-around, I copy-pasted the makefile from my project, so maybe tabs were removed.
If you want main.cpp in your root directory of your project. try this.
$(BIN)/$(EXECUTABLE): $(SRC)/*.cpp main.cpp
Thank you, I'm glad it helped.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I copy-pasted the Makefile content but when running make I was getting the error "mising separator. Stop".
I fixed adding a tab instead of spaces in lines 15, 16, 19 and 22:
run: clean all
[tab]clear
[tab]./$(BIN)/$(EXECUTABLE)
$(BIN)/$(EXECUTABLE): $(SRC)/*.cpp
[tab]$(CXX) $(CXX_FLAGS) -I$(INCLUDE) $^ -o $@ $(LIBRARIES)
clean:
[tab]-rm $(BIN)/*
Note: It woud be nice if the main.cpp file could be put in the root of the project folder, outside of src.
Great post by the way. I spent hours trying to compile in VS Code a multi file project before I seeing this.
Thanks!.
I'm glad you found a work-around, I copy-pasted the makefile from my project, so maybe tabs were removed.
If you want main.cpp in your root directory of your project. try this.
Thank you, I'm glad it helped.