Hey I am new to programming and especially new at C++. I am trying to create a makefile that will allow the compiler to compile a C++ program with separate class files in sublime text 3. Below is the current makefile I am using, however it isn't recognizing the header and class files of the C++ program.
{
"cmd": ["g++.exe", "-std=c++17", "-I.", "-o", "$file_base_name", "$file", "&&", "start", "cmd", "/c", "$file_base_name & echo. & echo. & pause"],
"shell": true,
"selector": "source.c++" }
If anyone could point out where the problem is and how to solve it so that the compiler will search and recognize the header and class files I would be grateful.
That is not a makefile. It however looks like it may be a script to generate one given the parameters.
I strongly suggest if you are new to c++ that you should write your own makefile from scratch.
below is an example makefile I grabbed from https://www.gnu.org/software/make/manual/html_node/Simple-Makefile.html Remember to name your makefile Makefile or makefile with no filetype extension.
edit : main.o kbd.o command.o display.o \
insert.o search.o files.o utils.o
cc -o edit main.o kbd.o command.o display.o \
insert.o search.o files.o utils.o
main.o : main.c defs.h
cc -c main.c
kbd.o : kbd.c defs.h command.h
cc -c kbd.c
command.o : command.c defs.h command.h
cc -c command.c
display.o : display.c defs.h buffer.h
cc -c display.c
insert.o : insert.c defs.h buffer.h
cc -c insert.c
search.o : search.c defs.h buffer.h
cc -c search.c
files.o : files.c defs.h buffer.h command.h
cc -c files.c
utils.o : utils.c defs.h
cc -c utils.c
clean :
rm edit main.o kbd.o command.o display.o \
insert.o search.o files.o utils.o