[gdal-dev] GDAL with external zlib

Frank Warmerdam warmerdam at pobox.com
Wed May 15 16:40:05 PDT 2013


Mihaela,

The -DFRMT_ZLIB item in gdal/frmts/makefile.vc is triggering use of the
local copy of zlib if OGDI is *not* configured as it includes a copy of
zlib.  It should in theory be practical to generalize that in some way so
the decision isn't based on OGDI but clearly it isn't common to build GDAL
on windows without it's own zlib since there is nothing in nmake.opt about
it.

I do believe it is fairly common on linux to build with the system zlib.

Best regards,
Frank



On Wed, May 15, 2013 at 4:18 PM, Mihaela Gaspar <
mihaela.gaspar at urbanrobotics.net> wrote:

> I have built GDAL, and was experimenting on a project.
>
> I have external zlib 1.2.5
>
> The external libraries are generally statically linked.
>
> When trying the same thing with gdal, I got a link error:
> error LNK2005: _deflate_copyright already defined in gdal.lib(deflate.obj)
>
> I tried to find where gdal is using zlib, to try to add the external
> reference, in similar fashion to other 3rd party software.
> There is no place to include zlib though, in frmts\makefile.vc there is
> something that I don't understand:
> EXTRAFLAGS = $(EXTRAFLAGS) -DFRMT_zlib
>
> And in port\makefile.vc there is an inclusion of the local zlib:
> EXTRAFLAGS =  -I..\frmts\zlib -DHAVE_LIBZ
>
>
> I tried to emulate other libs, by adding in nmake.opt:
> # External ZLIB
> ZLIB_INCLUDE = $(SDK)/zlib-1.2.5/build/include
>
> And replacing in port\makefile.vc the line above with
> !IFDEF ZLIB_INCLUDE
> EXTRAFLAGS =  $(ZLIB_INCLUDE) -DHAVE_LIBZ
> !ELSE
> EXTRAFLAGS =  -I..\frmts\zlib -DHAVE_LIBZ
> !ENDIF
>
> But it didn't build.
>
> How can I build with external zlib, to avoid version conflicts ?
>
> Thank you.
>
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>



-- 
---------------------------------------+--------------------------------------
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 Software Developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20130515/5d27d7bb/attachment.html>


More information about the gdal-dev mailing list