[gdal-dev] Stack Overflow in gdal with HDF5 using VC2008

atubar atubar at 126.com
Tue Aug 11 10:17:13 EDT 2009

I am sorry for that I can not take a test in VC++ 2005, because I built every essential dll in VC++ 2008, and I now only install VC2008 on my computer. Will it take any different results if  dlls built with different compiler ? 
I simply have a check in local : One with pre-built dlls from HDFGroup ,such as zlib, szip, jpeg . And the other with all dlls built from source.
But When reading a hdf5 file, they all gave me a report about  Stack Overflow. 
The HDF5 file is a sample data contained in hdfview which provided by HDFGroup and can be found in its website.
And the code I write is below:
#include <iostream>
using namespace std;
#include "gdal_priv.h"
#pragma comment(lib,"gdal_i.lib")
int main()
 char* filename="D:\\Documents and Settings\\Visual Studio 2008\\Projects\\GdalConsole\\Debug\\hdf5_test.h5";
 char *pszFormat="HDF5";
 GDALDriver *poDriver = GetGDALDriverManager()->GetDriverByName(pszFormat); 
////////////// here poDriver is non-null pointer////////////
 if( poDriver != NULL )
  cout<<"Gdal do not support HDF4!"<<endl;
 GDALDataset *poDataset;
 poDataset= (GDALDataset *) GDALOpen( filename, GA_ReadOnly);
/////////////////when code run here, it reports that stack overflow
 if(poDataset == NULL)
  return 0;
 return 0;


ÔÚ2009-08-08 00:45:37£¬"Chaitanya kumar CH" <chaitanya.ch at gmail.com> дµÀ£º

If you can try this with VC++2005, please do. In any case please tell the result here.

If you can, provide a sample data that gives this error so that the situation to be understood better.

2009/8/6 atubar <atubar at 126.com>

Hello, I am a freshman in working with Gdal and HDF5 in Visual C++ 2008. I have built essential dlls as those guides said. And I got gdal16.dll, hdf5dll.dll and more.
I set up a project , add include and lib to this project. Then I copy some sample codes to test how gdal and hdf5 works.
These codes below works successfully:
    char *pszFormat="HDF5";
    GDALDriver *poDriver = GetGDALDriverManager()->GetDriverByName(pszFormat);
It returns an non null poDriver.
But when I work with these codes below: 
    char* filename="..\\hdf5_test.h5";
    GDALDataset *poDataset;
    poDataset= (GDALDataset *) GDALOpen( filename, GA_ReadOnly);
it occurs an error like this below:
   Unhandled exception in **.exe:0xC00000FD:Stack Overflow 
How it comes? Is it a bug?What should I do ?

gdal-dev mailing list
gdal-dev at lists.osgeo.org

Best regards,
Chaitanya kumar CH.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20090811/5b46e8a1/attachment.html

More information about the gdal-dev mailing list