[GRASS5] problem grass library gis.a

N.J. Hardebol harj at geo.vu.nl
Wed Jul 2 04:21:48 EDT 2003


Hello grass developers,

I'm new to this grass-list, and am not sure if the basic questions below
should be asked in the devolpers list?
may the problems below has to do with deficiences in my programming skills.
I started to with shplib and ogr-libraries lately. I'm using grass for some
time and also plan to take advantage of the grass API /libraries to write
some geologic modelling tools (calculating strengths for european
lithosphere).
Some of the input data is already stored in both grass 2D raster format as
T(x,y,z) in a g3d format.

For this reason I would like to implement the functions:
G_open_cell_old (...)
G_get.......()
G3d_openCellOld (.....)
G3d_getDouble(G.....);
etc...
into my c++ routine.

I'm however confronted with several problems:
both gis.a as the g3d-library do offer problems. Concerning the g3d-lib I
can understand, since I had problems with the compilation of the g3d tool.
The comiplation (keep going) offered me the r3. ..... and g3. .....
grass-modules properly compiled (can be used) but possibly the g3d-library
not (see for compileOut.log at the end of this mail)

But the gis-library should work .. I guess
However when I compile my routine the following problem arises related to
the gis.a library:

nico at laptop:~/strength_map/strengthmap_prog/strengthmap_prog> make
g++ -o  TEST main.o g2d.o yld.o /usr/local/grass5/lib/*.a
/usr/local/grass5/lib/libgis.a(flate.o)(.text+0x393): In function
`G_zlib_compress':
/home/nico/grass5.0.2/src/libes/gis/flate.c:353: undefined reference to
`deflateInit_'
/usr/local/grass5/lib/libgis.a(flate.o)(.text+0x3a8):/home/nico/grass5.0.2/s
rc/libes/gis/flate.c:363: undefined reference to `deflate'
/usr/local/grass5/lib/libgis.a(flate.o)(.text+0x3c8):/home/nico/grass5.0.2/s
rc/libes/gis/flate.c:370: undefined reference to `deflateEnd'
/usr/local/grass5/lib/libgis.a(flate.o)(.text+0x420):/home/nico/grass5.0.2/s
rc/libes/gis/flate.c:375: undefined reference to `deflateEnd'
etc...

GNU g++ compiler version: g++ (GCC) 3.3 20030226 (prerelease) (SuSE Linux).
makefile:
# EXTRA_CFLAGS = -I/home/nico/software/grass5.0.2/src/include
PGM=r.example
LIST = main.o
GISLIB = /usr/local/grass5/lib/*.a
LIBES = $(GISLIB)
DEPLIBS = $(DEPGISLIB)

OBJ = main.o g2d.o yld.o
CC = g++
EXE = TEST

main: $(OBJ)
	$(CC) -o  $(EXE) $(OBJ) $(LIBES) $(MATHLIB) $(XDRLIB)

#$(BIN_CMD)/$(PGM): $(LIST) $(DEPLIBS)
#	$(CC) $(LDFLAGS) -o $@ $(LIST) $(LIBES) $(MATHLIB) $(XDRLIB)

main.o : main.cpp
	$(CC) -c main.cpp

g2d.o : g2d.cpp
	$(CC) -c g2d.cpp

yld.o : yld.cpp
	$(CC) - yld.cpp

I've downloaded a template routine (r.example) to check if I've done
something wrong but same problem comes back.
Does anyone have a solution?

G3D - library. While gis.h and gis.a can be found in /usr/local/grass5/
include & lib, the g3d.h and g3d.a(?) are not.
I was confronted with some problems while compiling g3d (grass5.0.2) -
gmake5:
make[3]: Entering directory
`/home/nico/software/grass5.0.2/src.contrib/GMSL/g3d/src3d/raster/r3.showdsp
f.openGL'
gcc -I/home/nico/software/grass5.0.2/src/include -g -O2   -I/home/nico/softw
are/grass5.0.2/src/libes/dspf -I/home/nico/software/grass5.0.2/src/libes/ogs
f   -I/usr/X11R6/include   -c debugf.c -o OBJ.i686-pc-linux-gnu/debugf.o
debugf.c:44:20: macro "va_start" requires 2 arguments, but only 1 given
debugf.c: In function `debugf':
debugf.c:44: error: `va_start' undeclared (first use in this function)

the compiler already suggested to change the header of
GMSL/g3d/src3d/raster/r3.showdspf.openGL/debugf.c with #include <stdarg.h>
instead of #### (forgotten).

thanking in advance

Nico









More information about the grass-dev mailing list