the compiler was complaining that it needed
a program called lex
a program called flex seems to be the same
thing

so i installed the program flex
with sudo apt-get install flex
and it solved that problem


but now when it tries to compile
it gives lots of undefined references



gcc -o ../bin/sdcc SDCCerr.o NewAlloc.o MySystem.o BuildCmd.o SDCCy.o SDCChasht.o SDCCmain.o SDCCsymt.o SDCCopt.o SDCCast.o SDCCmem.o SDCCval.o SDCCicode.o SDCCbitv.o SDCCset.o SDCClabel.o SDCCBBlock.o SDCCloop.o SDCCcse.o SDCCcflow.o SDCCdflow.o SDCClrange.o SDCCptropt.o SDCCpeeph.o SDCCglue.o spawn.o asm.o SDCCmacro.o SDCCutil.o SDCClex.o z80/port.a -lm
SDCCglue.o: In function `tempfilename':
/home/tom/gbdk/sdcc/src/SDCCglue.c:1573: warning: the use of `tmpnam' is dangerous, better use `mkstemp' /home/tom/gbdk/sdcc/src/SDCCglue.c:1566: warning: the use of `tempnam' is dangerous, better use `mkstemp'
SDCCmain.o: In function `preProcess':
/home/tom/gbdk/sdcc/src/SDCCmain.c:1311: undefined reference to `yyin'
SDCCmain.o: In function `main':
/home/tom/gbdk/sdcc/src/SDCCmain.c:1553: undefined reference to `yyin'
/home/tom/gbdk/sdcc/src/SDCCmain.c:1610: undefined reference to `yyin'
SDCCy.o: In function `yyparse':
/home/tom/gbdk/sdcc/src/SDCCy.c:4001: undefined reference to `yyerror'
/home/tom/gbdk/sdcc/src/SDCCy.c:1986: undefined reference to `yylex'
SDCCy.o: In function `yyparse':
/home/tom/gbdk/sdcc/src/SDCC.y:499: undefined reference to `yytext'
/home/tom/gbdk/sdcc/src/SDCC.y:485: undefined reference to `yytext'
SDCCy.o: In function `yyparse':
/home/tom/gbdk/sdcc/src/SDCCy.c:4145: undefined reference to `yyerror'
SDCCy.o: In function `yyparse':
/home/tom/gbdk/sdcc/src/SDCC.y:503: undefined reference to `yytext'
/home/tom/gbdk/sdcc/src/SDCC.y:489: undefined reference to `yytext'
SDCCsymt.o: In function `newSymbol':
/home/tom/gbdk/sdcc/src/SDCCsymt.c:293: undefined reference to `yylineno'
SDCCsymt.o: In function `mergeSpec':
/home/tom/gbdk/sdcc/src/SDCCsymt.c:567: undefined reference to `yytext'
SDCCast.o: In function `newAst_':
/home/tom/gbdk/sdcc/src/SDCCast.c:116: undefined reference to `yylineno'
/home/tom/gbdk/sdcc/src/SDCCast.c:117: undefined reference to `currFname'
SDCCast.o: In function `createFunction':
/home/tom/gbdk/sdcc/src/SDCCast.c:4142: undefined reference to `yylineno'
SDCCval.o: In function `newiList':
/home/tom/gbdk/sdcc/src/SDCCval.c:59: undefined reference to `yylineno'
collect2: error: ld returned 1 exit status
make[2]: *** [../bin/sdcc] Error 1
make[2]: Leaving directory `/home/tom/gbdk/sdcc/src'
make[1]: *** [sdcc-cc] Error 2
make[1]: Leaving directory `/home/tom/gbdk/sdcc'
make: *** [sdcc-build] Error 2



i noticed one of the lines mentions lex:
/home/tom/gbdk/sdcc/src/SDCCy.c:1986: undefined reference to `yylex'

could this be caused by missing library’s or is this just a bug in the program i need to try and fix?

Reply via email to