[Gdal-dev] Problems Linking to the gdal

Frank Warmerdam warmerdam at pobox.com
Wed Jun 23 18:38:22 EDT 2004


Daniel Mac wrote:
> Hello, I am relatively new to this board, so please forgive if this question
> has been answered, or if I went about the wrong way to post a question...
> 
> Im having trouble linking to the GDAL libraries.  I've downloaded and built
> GDAL (1.1.9, 1.2.0, 1.2.0b, I've tried em all) for Solaris 2.8 using gcc and
> gnumake...however, I am using the latest version of Sun Forte CC to build my
> application, and when I try to link to the GDAL libraries (libgdal.a,
> libgdal.so), I get the following error:
> 
> ild: (undefined symbol) GDALRasterBand*GDALDataset::GetRasterBand(int) --
> referenced in the text segment of
> /home/Projects/Deployment/Tencap/lib/SunOS-5.8//libTencap.a(_DTEDReader.o)
> ild: (undefined symbol) void GDALRasterBand::GetBlockSize(int*,int*) --
> referenced in the text segment of
> /home/Projects/Deployment/Tencap/lib/SunOS-5.8//libTencap.a(_DTEDReader.o)
> ild: (undefined symbol) int GDALRasterBand::GetYSize() -- referenced in the
> text segment of
> /home/jhughes/ElanTech/Projects/Deployment/Tencap/lib/SunOS-5.8//libTencap.a
> (_DTEDReader.o)
...
>> Question 1:  Ive tried to build GDAL with Sun Forte CC, only to run into
> loads of problems; is there a proper way to build GDAL using Sun Forte CC
> (required flags, settings at ./configure command, etc.?)

Daniel,

In theory you should be able to set the CC and CXX environment variables
before running configure.  However, you might find it easier to just hack the
GDALmake.opt after configure finishes.

What sorts of problems are you running into with Forte CC?

> Question 2:  I've heard of incompatibilities between CC and gcc/g++; could
> this problem just be a case of incompatibility??  If so, then any help in
> building GDAL using CC would be greatly appreciated...

The name mangling used by gcc for C++ is different than that used by other
compilers, so you can't mix C++ object code from different compilers.  At
least not for inter system calls.

If you modified your DTEDReader code to call the GDAL C API instead then you
wouldn't have a problem.  The C function naming in object files is consistent
between compilers and in various ways the C interface is less fragile than the
C++ one.

So my suggestions are to either recode your calls to the C API, or ensure you
are using the same C++ compiler for everything.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list