[GRASS-dev] compiling today's grass7 trunk: ogr_srs_api.h: No
such file or directory
Moritz Lennert
mlennert at club.worldonline.be
Thu Jun 18 03:43:33 EDT 2009
On 17/06/09 23:59, Glynn Clements wrote:
> Moritz Lennert wrote:
>
>>>> I get the following error running make in swig/python in grass7
>>>> of today (rev 37908).
>>>>
>>>> In file included from proj_wrap.c:2694:
>>>> /home/mlennert/SRC/GRASS/grass_trunk/dist.i486-pc-linux-gnu/include/grass/gprojects.h:23:29:
>>>> error: ogr_srs_api.h: No such file or directory The file
>>>> ogr_srs_api.h sits in /usr/include/gdal/.
>>>>
>>>> Any ideas of what is wrong here ?
>>> The libgrass_gproj wrapper includes <grass/gprojects.h>, which
>>> includes ogr_srs_api.h. It adds (or should add) $(PROJINC) and
>>> $(GDALCFLAGS) when compiling the wrapper.
>> In swig/python/Makefile, I see
>>
>> proj_wrap_c_FLAGS = $(PROJINC) $(GDALCFLAGS)
>>
>> but I don't really understand where this comes into play.
>
> This should ensure that proj_wrap.c can find the PROJ and GDAL
> headers.
Yes, but what I meant is that I don't see where the proj_wrap_c_FLAGS
variable is read.
>
>> Am I the only one seeing this error ?
>
> I don't see it. It would be help if you post the gcc command which
> generates the error message.
>
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 -I/usr/include/python2.5 -I/usr/include/python2.5
-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/proj_wrap.o -c proj_wrap.c
In file included from proj_wrap.c:2694:
/home/mlennert/SRC/GRASS/grass_trunk/dist.i486-pc-linux-gnu/include/grass/gprojects.h:23:29:
error: ogr_srs_api.h: No such file or directory
In file included from proj_wrap.c:2694:
/home/mlennert/SRC/GRASS/grass_trunk/dist.i486-pc-linux-gnu/include/grass/gprojects.h:84:
error: expected '=', ',', ';', 'asm' or '__attribute__' before
'GPJ_grass_to_osr'
/home/mlennert/SRC/GRASS/grass_trunk/dist.i486-pc-linux-gnu/include/grass/gprojects.h:88:
error: expected declaration specifiers or '...' before
'OGRSpatialReferenceH'
make[1]: *** [OBJ.i486-pc-linux-gnu/proj_wrap.o] Error 1
make[1]: Leaving directory
`/home/mlennert/SRC/GRASS/grass_trunk/swig/python'
make: *** [default] Error 2
So it seems that the gdal includes directory is not taken into account.
In include/Make/Platform.make I see:
GDALCFLAGS = -I/usr/include/gdal
[...]
PROJINC = $(GDALCFLAGS)
so at least /usr/include/gdal should be in the gcc line, I guess.
Moritz
More information about the grass-dev
mailing list