New problem compiling grass5.0beta7

Michel Wurtz - ENGEES/CEREG mw at
Wed Apr 26 04:27:37 EDT 2000

Skip wrote:
> Hi Markus,
> Well the problems continue. I made all the changes you suggested but still received the following error message, which on brief glance looks exactly like the message I received before:
> make[1]: Entering directory `/usr/local/grass5.0beta/src/raster/r.binfer'
> rm -f lex.c gram.c
> yacc binfer.y
> rm -f gram.c
> mv gram.c
> rm -f OBJ.i686-linux-elf/gram.o
> gcc -g -O2   -I/usr/local/grass5.0beta/src/include  -c gram.c
> mv gram.o OBJ.i686-linux-elf/gram.o
> lex binfer.l
> rm -f lex.c
> mv lex.yy.c lex.c
> rm -f OBJ.i686-linux-elf/lex.o
> gcc -g -O2   -I/usr/local/grass5.0beta/src/include  -c lex.c
> binfer.l:41: redefinition of `yylineno'
> lex.c:271: `yylineno' previously defined here

The problem with yylineno is that it's an "undocumented feature" of the
original AT&T lexical analyser, but not a part of the ISO standard.
This is why some implementation of lex automaticaly add it, and some

On linux side, or better said when you use the GNU compiler package,
there is no lex program, but a flex program, that is ISO compliant.
As for many Gnu program, you have an option that made flex to work
like the original lex program (the lex program on linux is simply
a shell script saying "flex -l $*")

It should be also noted that the -l flag also change the output code
produced by flex : yylineno must contain the line number of the input
file of r.binfer, hence producing accurate error message when something
is wrong in it...

Clearly, if you use "lex" or "flex -l", you should not put a line with
"int yylineno=1" in binfer.l.  A quick and dirty fix : remove this line
(#41 in binfer.l) and run again gmake5...

Michel Wurtz    ENGEES - CEREG
                1, quai Koch - BP 1039, F-67070 STRASBOURG cedex
                Tel: +33  Fax: +33

More information about the grass-user mailing list