[gdal-dev] Build GDAL - visual studio version

Mateusz Loskot mateusz at loskot.net
Tue Sep 20 18:41:18 EDT 2011


On 20/09/11 18:14, Cole, Derek wrote:
> If GDAL is linked statically, and I recompile my library, will this 
> still be the case?

If you link GDAL against static C/C++ libs, you don't need to
deploy the C/C++ run-time re-distributable DLLs.

http://msdn.microsoft.com/en-us/library/abx4dbyh.aspx
http://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx

> Can I recompile GDAL with MT instead of with the DLLs?

In theory, you can but in practice...you need to try to find out -
that's the safest answer I can give myself.
Microsoft does not recommend to link statically to the C/C++ run-time in
DLL. It is easy to mismatch different types of C/C++ run-times
especially if a DLL has a lot of third-party dependencies.
See questions 9 and 10 for clarification http://zlib.net/DLL_FAQ.txt

You can tweak the flags in nmake.opt file

http://trac.osgeo.org/gdal/browser/trunk/gdal/nmake.opt#L107

In nutshell, linking against C/C++ run-time dynamically and
deploying the C/C++ run-time on a client. It's highly possible your
client will need those run-time DLLs anyway, required by GDAL
dependencies or other software.

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org
Member of ACCU, http://accu.org


More information about the gdal-dev mailing list