[gdal-dev] question about build static gdal with visual studio

Frank Warmerdam warmerdam at pobox.com
Tue Aug 30 11:22:30 EDT 2011

On 11-08-30 01:12 AM, tang qingyuan wrote:
> HI !
>      gdal is default build to dynamic lib with visual studio.How can I build it
> to static lib ? Maybe a stupid question,But I cannot get the answer on mail
> list.  Thanks!

Tang Qingyuan,

In fact, I think you can get the answer on the mailing list!

I believe a default build of GDAL includes creation of the gdal.lib static
library which you can use to build against.  I think if you comment out the
following line in the nmake.opt file, then the gdal.lib will be used by
default when linking the commandline programs instead of the DLL stub library

# Uncomment the following to link OGR utilities against main GDAL DLL
# instead of statically linking against OGR libraries.

I must confess to not having used this in some time so it could be broken.

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