[Gdal-dev] compile help on windows, gdal-1.2.3

Frank Warmerdam fwarmerdam at gmail.com
Tue Feb 1 10:27:22 EST 2005


On Tue, 01 Feb 2005 00:50:52 -0600, John K. Grant <grant at cyrf.com> wrote:
> Hi,
> I am trying to complile gdal on windows.  After modifying nmake.opt to
> find libjpeg and libpng, I see that the gdal_i.lib file is in fact
> created, but there are errors as it tries to create the .dll.  Can
> someone please help me to make the .dll compile?
> The errors can be seen at the bottom of this output file:
> http://cyrf.com/temp/gdal_errors.txt

John,

You have a conflict between components compiled to use LIBC
and those compiled to use MSVCRT.  One is the "static" C library
support, and the other is a seperate runtime C library DLL.  

My guess would be that your libjpeg and/or libpng are compiled
to use libc, and you have built GDAL the default way to use MSVCRT.

Basically, you can't practically mix object code built for different modes
with MSVC.  Either build everything the same way, or build libpng and
libjpeg as DLLs, and only link against the stub library instead of the full
static library.  

BTW, it is the /MD compiler option that select MSVCRT.  Leaving it
off should default to using LIBC.  I encourage use of MSVCRT though
it isn't strictly necessary.

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