[GRASSLIST:1819] Re: grass build error: compilation error in r.in.gdal

Kirk R. Wythers kwythers at umn.edu
Wed Nov 19 10:28:09 EST 2003


On Nov 19, 2003, at 2:19 AM, Glynn Clements wrote:

>
> OK. I believe that this is because you need some additional switches
> when linking against C++ code (most of GDAL is C++).
>
> It may suffice to replace "gcc" with "g++" in the link command. Either
> by running the above command manually, but substituting "g++" for
> "gcc", or by editing src/raster/r.in.gdal/Gmakefile, changing $(CC) to
> "g++".
>
> Typically, there would be a standard library (or even a simple object
> file) which defines the above symbols, and using g++ as the linker
> will use that library (or object file) automatically.
>
> E.g. on Linux, C++ programs use libstdc++. Linking with "g++"
> automatically implies "-lstdc++"; if you link with "gcc", you have to
> explicitly add "-lstdc++" to the link command.
>
> Note: this issue doesn't normally arise for shared libraries, as they
> typically include dependency information, so the linker will add any
> dependent libraries automatically.

I'll be damned... that did it Glynn. I have not used it yet but the 
compile finished without any errors. Just for the sake of the continued 
pursuit of knowledge, why was this an issue on my machine and not for 
others (who appeared... superficially at least, to be building on the 
same/similar hardware and os (OSX 10.3.1, gcc 3.3 from xtools)?

Thank you

>
> I suppose that the gdal-config script should really deal with this.
>
> -- 
> Glynn Clements <glynn.clements at virgin.net>
>
------------------------------------------------------------------------
Kirk R. Wythers	                                     tel: 612.625.2261
Dept. of Forest Resources                 fax: 612.625.5212
University of Minnesota      email: kwythers at umn.edu
------------------------------------------------------------------------




More information about the grass-user mailing list