[GRASS5] Next 5.7 link problem

Radim Blazek blazek at itc.it
Mon Nov 17 06:06:19 EST 2003


On Friday 14 November 2003 21:12, you wrote:
> Jens Oberender wrote:
> > I left nls of and now have the next error:
> >
> > OBJ.i686-pc-linux-gnu/expression.o(.text+0x53c): In function `variable':
> > /usr/src/packages/BUILD/grass57_exp_2003_11_08/raster/r.mapcalc/expressio
> > n.c:199: undefined reference to `syntax_error'
> >
> > OBJ.i686-pc-linux-gnu/main.o(.text+0x217): In function `main':
> > /usr/src/packages/BUILD/grass57_exp_2003_11_08/raster/r.mapcalc/main.c:12
> > 2: undefined reference to `parse_string'
> >
> > OBJ.i686-pc-linux-gnu/main.o(.text+0x279):/usr/src/packages/BUILD/grass57
> > _exp_2003_11_08/raster/r.mapcalc/main.c:147: undefined reference to
> > `parse_stream'
> >
> > Any hints?
>
> This is a known problem with the 5.7 build system. It constructs the
> list of .o files to build from the list of the .c files which
> initially exist in the directory. Anything for which the source file
> isn't a .c file won't be built. In the case of r.mapcalc, one of the
> source files is lex file (mapcalc.l) and another is a yacc file
> (mapcalc.y). The undefined functions are defined in mapcalc.y.
>
> Whilst the Makefile does have the necessary rules to build the
> intermediate C files (lex.yy.c and y.tab.c), those .c files don't
> exist at the point that the list of .o files is constructed, so they
> never get compiled.
>
> If you build the underlying 5.3 tree first (assuming that you did
> "make mix" rather than "make copymix"), that will generate lex.yy.c
> and y.tab.c, and 5.7 should then build correctly. Alternatively, you
> should be able to generate those files manually with something like:
>
> 	make -C raster/r.mapcalc lex.yy.c y.tab.c

There is a list of all .o files in the Makefile, the only problem IMHO was,
that it was called OBJ instead of CMD_OBJS.

Radim




More information about the grass-dev mailing list