[Gdal-dev] GDAL conflicts (copysign() and snprintf() )

Frank Warmerdam warmerdam at pobox.com
Fri Nov 10 18:41:15 EST 2006

Ozy Sjahputera wrote:
> I am trying to build a C++ project that uses GDAL by including 
> gdal_priv.h, cpl_string.h, ogr_spatialref.h and gdalwarper.h.  The 
> project was initially created in a Linux environment (Gentoo) and was 
> running fine.  While the linux box is being rebuilt, I have to work 
> using an XP machine.  The project compiles and runs fine when built 
> using VC .NET (2003).  But it throws errors when built using MinGW (with 
> Eclipse CDT IDE).
> The two functions cited for these errors are copysign and snprintf. 
> After some digging I found that cpl_config.h contains some constants 
> that indicates whether these functions are present. I am guessing that 
> the settings in cpl_config.h are designed to work with VC++ libraries, 
> but problems arises when one uses MinGW libraries.
> Any idea how to resolve these conflicts?


When you build with Visual Studio the gdal/port/cpl_config.h.vc file is
copied over gdal/port/cpl_config.h.  When building on linux, or cygwin
the configure generates the gdal/port/cpl_config.h.

Are you using Cygwin's make, and related stuff for your mingw build?  If
so, you have to be careful to rerun configure after building in the same
tree with visual studio.

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    | President OSGeo, http://osgeo.org

More information about the Gdal-dev mailing list