I'm having trouble with the linking of my files.

Basically, my program consists of:

  • The main program, gen1.
  • gen1: It receives input, sends it to str2value for processing, outputs results str2value, breaks input into tokens using "tokenizer" determines what sort of processing to do to each token, and passes them off to str2num, or str2cmd. It then returns an array of the results.
  • str2num: Does some processing
  • str2cmd: Ditto
  • author.py: A python script that generates str2cmd.c and str2cmd.h from a header cmdTable.h.

I'm pretty sure I have my includes right. I've checked a couple of times, and I've also checked that there are no conditions #ifndef wrong in the headers.

Here is my Makefile:

#CPP = g++ -lserial
CPP = g++ -DTESTMODE
C= gcc
DEFINES = LURC
CFLAGS = -Wall -fshort-enums -D$(DEFINES)
PROJECTFILES = gen1.cpp str2value.o

STR2VALUEFILES = str2value.cpp str2cmd.o str2num.o tokenizer.o str2value.h

gen1 : $(PROJECTFILES)
        $(CPP) $(CFLAGS) -o gen1 $(PROJECTFILES)


str2value.o : $(STR2VALUEFILES)
#       echo "str2value"
        $(CPP) $(CFLAGS) -c $(STR2VALUEFILES)

str2num.o: str2num.cpp  str2value.h str2num.hpp
         $(C) $(CFLAGS) -c $^


tokenizer.o: tokenizer.cpp tokenizer.hpp
        $(CPP) $(CFLAGS) -c $^

str2cmd.o : authorCMDs.py cmdTable.h
        python authorCMDs.py cmdTable.h str2cmd #this uses the gcc -E cmdTable.h -DLURC
        $(C) $(CFLAGS) -c str2cmd.c str2cmd.h

#TODO: add a thing that checks str2cmd.h/.c has not been modified by hand


.PHONEY: clean
clean:
        rm *.o

.PHONEY: all
all:
        clear
        make clean
        make

Here is the output I receive from make all:

                        
                        c++
                        
                        c
                        
                        gcc
                        
                        makefile
                        
                        linker-errors
                        
                    
Edit
Report