[GRASS5] g51: v.out.ogr compilation
Piero
pi.cavalieri at tiscali.it
Thu Jan 23 06:54:08 EST 2003
Glynn Clements wrote:
>Piero wrote:
>
>
>
>>when compiling g51 I have the following messages:
>>
>>
>
>
>
>>OBJ.i686-pc-linux-gnu/main.o: In function `main':
>>/home/piero/unst_g/grass51_exp_2002_11_15/vector/v.out.ogr/main.c:145:
>>*/undefined reference to `OGRRegisterAll' /*
>>
>>
>
>
>
>>As you see the module is compiled, but it is not linked in grass51 (if
>>linked is the correct term). (I have grass51 in the bin.arch dir, it
>>runs, but v.out.ogr doesn't works).
>>I tried to watch in the Makefile (that specific for the module and
>>those in the upper dirs) but I don't fully understand
>>them (or I don't understand anything, this is a point of view). For
>>example, in the Makefile for the module, It's used the GDALCFLAGS
>>variable. In Platform.make I have:
>>
>>#GDAL
>>GDALLIBS = -ldl
>>GDALCFLAGS =
>>
>>Pheraps I have compiled GDAL without the GRASS support, however what
>>GDALCFLAGS represent ? It goes to EXTRA_CFLAGS so should it used to
>>specify additional include dirs ? (I have gdal in a standard dir
>>(specified both in /etc/ld.so.conf end in my ~/.bashrc), so probable
>>it's correct that the field is empty).
>>If I configure gdal --with-grass=ARG (ARG=no or libgrass path) what
>>does libgrass mean? (libgrass5 doesn't exist!).
>>(Perhaps this option is for other (than GRASS) program that must use
>>GDAL and GRASS utilities?)
>>
>>
>
>1. You don't need to build GDAL with GRASS support.
>
>2. I suspect that you do need to use "configure ... --with-gdal".
>
>Basically, there are two ways in which the GDAL library can be used;
>it can either be linked against directly during the build process, or
>it can be dynamically loaded at run-time using dlopen() (this is the
>mechanism which programs typically use for "plugins").
>
>If you use the --with-gdal configure switch, it will be linked
>directly, otherwise it will be dynamically loaded. However, it appears
>that v.out.ogr doesn't support the dynamic loading mechanism (in
>GRASS5, the only program which uses GDAL is r.in.gdal, which supports
>both methods).
>
>I suggest trying "configure ... --with-gdal";
>
I'm a stupid. I'm used to put the configure command with all the option
I want & need
in a executable file, then run ./my_configure, so I save time if I have
to recompile.
When I saw that there was a --with-gdal option, I lanuched:
./my_configure --with-gdal
but in this manner the second part isn't interpretated by the shell!
>that should result in
>something similar to the following in Platform.make:
>
> GDAL_LIBS = -lgdal.1.1
> GDAL_CFLAGS = -DUSE_GDAL_H
>
>
>
#GDAL
GDALLIBS = -L/usr/local/lib -lgdal.1.1
GDALCFLAGS = -I/usr/local/include -DUSE_GDAL_H
Ok, it works.
Thank you.
Piero
More information about the grass-dev
mailing list