First I will state, this is homework. I am stuck on this makefile thing and need assistance. I can't figure out why it is getting stuck where it is. I am using a header.h file, a header.cpp file, and a project.cpp file. I will post my makefile first, then the header.h, then the header.cpp. Both the header.cpp and project.cpp compile fine individually, but I get this error at the end of the makefile:
g++ -g -c proj4.cpp
g++ -g -c stackhh.cpp
g++ -o project4 proj4.o
Undefined first referenced
symbol in file
Stack::pop(char&) proj4.o
Stack::push(char) proj4.o
Stack::Stack(int) proj4.o
Stack::~Stack() proj4.o
ld: fatal: symbol referencing errors. No output written to project4
collect2: ld returned 1 exit status
*** Error code 1
make: Fatal error: Command failed for target `project4'
This is due at midnight tonight and if I can't get it to compile, I am SOL. Thanks for the assistance in my learning!!!
EDIT: The solution:
1 2 3 4 5
|
the first and second line should read:
project4: proj4.o stackhh.o
g++ proj4.o stackhh.o -o project4
| |
I know this is a lot of code thrown up, but I don't know where to start with this issue! I will keep trying to troubleshoot, but I am ew to makefile and when I had this all in one program it compiled just fine! Not sure where they aren't syncing... I appreciate any and all help, thank you soooo much in advance!
-Arcie