[Gdal-dev] building GDAL in Visual C++ Toolkit 2003

Hamish hamish_nospam at yahoo.com
Fri Mar 4 22:24:58 EST 2005


On Fri, 4 Mar 2005 18:14:44 +0100 (CET)
bartvde at xs4all.nl wrote:

> Hi list,
> 
> I tried to compile GDAL using the free Visual C++ Toolkit 2003 in
> combination with the Microsoft Platform SDK, and the .NET Framework
> SDK.
> 
> I ran into the following problem:
> 
> C:\projects\gdal-1.2.5\frmts\gtiff\libtiff\tiffio.h
> 
> tiffio.h uses <iostream.h> which is deprecated, I had to change it
> into the following:
> 
> #if defined(c_plusplus) || defined(__cplusplus)
> # include <iostream>
> extern	TIFF* TIFFStreamOpen(const char*, std::ostream *);
> extern	TIFF* TIFFStreamOpen(const char*, std::istream *);
> #endif
> 
> Is there any reason not to use this in the standard GDAL distribution?



general gotcha to be aware of:
  <iostream> is ok but <ostream> isn't always..

#include <ostream>   // will not compile with gcc <= 2.96


needs something like:

#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
#include <ostream>
#else
#include <ostream.h>
#endif


see  http://grass.itc.it/pipermail/grass5/2004-November/015840.html



Hamish



More information about the Gdal-dev mailing list