I have this C++ program in Clion, however, I need to create a makefile for it to be run on text editors and not IDEs, it is for a university, they do not use IDEs.
When I run my program trough the run button on CLion, it works perfectly but when I run it trough the makefile, it displays multiple errors that don't even make sense.
When is the issue occurring from? Please tell me if you need more information or images.
Project structure:
Errors with makefile:
Run without the makefile:
Makefile:
OBJS = main.o HastTable.o Book.o
SOURCE = main.cpp HastTable.cpp Book.cpp
HEADER = HashTable.h Book.h
OUT = book
CC = g++
FLAGS = -g -c -Wall -Wextra
all: $(OBJS)
$(CC) -g $(OBJS) -o $(OUT) $(LFLAGS)
main.o: main.cpp
$(CC) $(FLAGS) main.cpp
HastTable.o: HastTable.cpp
$(CC) $(FLAGS) HastTable.cpp
Book.o: Book.cpp
$(CC) $(FLAGS) Book.cpp
clean:
rm -f $(OBJS) $(OUT)