Ok, first of all here's my code:
I think there's something wrong as when I run make it can't found the function which is defined in util.c and global.hCode:CC = gcc CFLAGS = -g CFILES = main.c lex.yy.c y.tab.c util.c OFILES = main.o lex.yy.o y.tab.o util.o HFILES = y.tab.h globals.h util.h scan.h compile: $(OFILES) $(CC) $(CFLAGS) $(OFILES) -lfl -o compile y.tab.c : parse.y util.h scan.h yacc -v -d parse.y lex.yy.c : scan.l y.tab.h globals.h flex scan.l y.tab.h : parse.y util.h scan.h yacc -v -d parse.y clean: /bin/rm -f compile lex.yy.c y.tab.c y.tab.h *.BAK *.o
The file scan.l is using an extern variable which is defined in the globals.h file, and I've already included globals.h on the header of scan.l.
Can you tell me what's wrong here?