I'm getting an undefined reference to 'main' error. I tried a few things and can't seem to quite get it. I'm trying to make the name of my executable hw1.exe
any suggestions? Thanks.
I don't see anything terribly wrong with your makefile. If anything, lines 5, 8, 11, 14, 17, and 21 should begin with a tab; I doubt that would break it, though. Also, I don't think CFLAGS are necessary on line 5--LDFLAGS are typically passed for that; again, this wouldn't break it.
So, what we need is a little more information:
1. Where is the main function? Please post its signature.
2. What is the output of 'make clean; make'
Undefined reference errors come from the linker (ld). It often means that either a function was not defined or that an object file was left out. For example, if there's a hw1.cpp, main.cpp or something similar that contains main, it would need to be added in the makefile.