[Gdal-dev] GeoTiff: Exporting libtiff symbols

Frank Warmerdam warmerdam at pobox.com
Fri Nov 26 09:18:25 EST 2004


Todd Jellett wrote:
> Hi all,
> 
> I'm setting up a build (.NET 2003) of gdal-1.2.5 with all libraries
> external to gdal (including geotiff and libtiff).
> 
> I want to be able to produce both static and DLL versions of
> the geotiff and libtiff libraries.
> 
> In the geotiff (1.2.2) makefile.vc there is the following note:
> 
> #
> #       Note: Building a DLL is OK as far as libgeotiff is concerned,
> #       but tiff.lib will get linked into $(GEOTIFF_DLL) without actually
> #       exporting it's interface.  This means another copy will get
> #       pulled into the application and this could lead to much confusion.
> #       Only build $(GEOTIFF_DLL) if you are also ensuring that TIFF 
> symbols
> #       get exported.
> #
...
> 
> Can someone explain this further. If both the geotiff library and
> the tiff library are produced as DLLs, why wouldn't the symbols
> for the tiff library be exported. This seems to totally defeat the
> main premise for using "shared" libraries.
> 
> How would one ensure that the tiff symbols get exported?

Todd,

In fact, I believe the above comment dates from a time when libgeotiff was
linking against a static libtiff (libtiff.lib) where as now it links against
libtiff_i.lib by default when building a DLL.  libtiff_i.lib is a stub library
for the DLL.

The geotiff.dll will not export the libtiff API, but then libtiff isn't really
getting included in the geotiff.dll anymore.  So an application wanting to use
libtiff and libgeotiff would need to link against both stub libraries
(geotiff_i.lib and libtiff_i.lib).  I will remove the now misleading comment
from the libgeotiff makefile.vc.

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