I have a header file cerealmanager.h and a main file called cerealmanager.cpp and a file called project2.cpp, which just has catch 2 tests.
Whenever I run my code with the makefile it says that all of my functions are undefined
(undefined reference CerealManager::(functionname).
How do I solve this issue?
makefile
CPP_FLAGS = -std=c++11 -Wall -Wextra -Werror
# uncomment for Linux/Mac OS X
#RM = rm -f
# uncomment for Windows (make sure MinGW/MSYS are installed!)
RM = del
project2.exe: project2.cpp cerealmanager.o
g++ $(CPP_FLAGS) project2.cpp cerealmanager.o -o project2.exe
cerealmanager.o: cerealmanager.h cerealmanager.cpp
g++ $(CPP_FLAGS) -c cerealmanager.cpp -o cerealmanager.o
clean:
$(RM) *.o
cleanall: clean
$(RM) *.exe