[GRASS-dev] compiling today's grass7 trunk: ogr_srs_api.h: No such file or directory

Glynn Clements glynn at gclements.plus.com
Wed Aug 5 18:30:40 EDT 2009


Moritz Lennert wrote:

> I'm having the same problem again with today's svn trunk:
> 
> gcc 
> -I/home/mlennert/SRC/GRASS/grass_trunk/dist.i486-pc-linux-gnu/include 
> -I/home/mlennert/SRC/GRASS/grass_trunk/dist.i486-pc-linux-gnu/include 
> -Wall -g -O2   -fPIC  -D_FILE_OFFSET_BITS=64 -DPACKAGE=\""grasslibs"\" 
>    -I/home/mlennert/SRC/GRASS/grass_trunk/dist.i486-pc-linux-gnu/include 
> -I/home/mlennert/SRC/GRASS/grass_trunk/dist.i486-pc-linux-gnu/include -o 
> OBJ.i486-pc-linux-gnu/find_vect.o -c find_vect.c
> find_vect.c:22:21: error: ogr_api.h: Aucun fichier ou répertoire de ce type
> find_vect.c: In function �find_ogr�:
> find_vect.c:96: error: �OGRDataSourceH� undeclared (first use in this 
> function)
> find_vect.c:96: error: (Each undeclared identifier is reported only once
> find_vect.c:96: error: for each function it appears in.)
> find_vect.c:96: error: expected �;� before �Ogr_ds�
> find_vect.c:100: warning: implicit declaration of function �OGRRegisterAll�
> find_vect.c:103: error: �Ogr_ds� undeclared (first use in this function)
> find_vect.c:103: warning: implicit declaration of function �OGROpen�
> make: *** [OBJ.i486-pc-linux-gnu/find_vect.o] Erreur 1
> 
> I can solve that with the following:
> 
> Index: lib/gis/Makefile
> ===================================================================
> --- lib/gis/Makefile	(révision 38619)
> +++ lib/gis/Makefile	(copie de travail)
> @@ -4,7 +4,7 @@
> 
>   EXTRA_LIBS = $(DATETIMELIB) $(PTHREADLIBPATH) $(PTHREADLIB) \
>   	$(INTLLIB) $(MATHLIB) $(ZLIBLIBPATH) $(ZLIB) $(GDALLIBS)
> -EXTRA_INC = $(ZLIBINCPATH) $(PTHREADINCPATH)
> +EXTRA_INC = $(GDALCFLAGS) $(ZLIBINCPATH) $(PTHREADINCPATH)
> 
>   DATASRC = ellipse.table datum.table datumtransform.table FIPS.code 
> state27 state83 projections
> 
> but am not sure that this is the correct approach.
> 
> Can someone tell me if it is ?

The correct approach is to revert the portion of r38552 which applies
to lib/gis/find_vect.c, lib/gis/find_file.c, and lib/gis/Makefile. 

lib/gis has no business calling OGR functions, or even linking against
OGR. If it's impossible to "find" a vector without them, then
find_vect.c should be removed altogether, and the functions moved into
the vector library.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list