[GRASS5] Next 5.7 link problem

Glynn Clements glynn.clements at virgin.net
Fri Nov 14 15:12:10 EST 2003


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

-- 
Glynn Clements <glynn.clements at virgin.net>




More information about the grass-dev mailing list