[gdal-dev] Stack Overflow in gdal with HDF5 using VC2008
atubar
atubar at 126.com
Thu Aug 13 03:52:46 EDT 2009
Today, I find a computer with VS2005 installed on it. And I build gdal 1.6.1 with pre-built dlls supplied as package named win42r4-VS2005-IVF101, hdf5_183_xp32_vs2005_ivf91 from HDFGroup website. While building, warnings can be ignored, and no error occurs.
I copy dlls such as gdal16.dll, hd424m.dll, hm424m.dll, hdf5dll.dll, szlibdll.dll(from szip21-vs2005-enc), zlib1.dll(from zlib123-vs2005) into the project folder. And add include and lib of gdal built results to the project.
Then I modify the program as what you said. The modified code is listed below:
//------------------------------------//
#include <iostream>
#include "gdal_priv.h"
#pragma comment(lib,"gdal_i.lib")
using namespace std;
int main()
{
GDALAllRegister();
const char* filename="D:\\RSI\\IDL63\\examples\\data\\africavlc.png";
const char* pszFormat="HDF5";
GDALDriver *poDriver = GetGDALDriverManager()->GetDriverByName(pszFormat);
if( poDriver != NULL )
{
////........................
////THe program can run here.
}
else
{
cout<<"Gdal do not support HDF5!"<<endl;
}
GDALDataset *poDataset;
poDataset= (GDALDataset *) GDALOpen( filename, GA_ReadOnly);
//The program reports an error like this.
//Unhandled exception in **.exe:0xC00000FD:Stack Overflow
//Then the compiler ask me wether to Break up the program.
if(poDataset == NULL)
{
cout<<"error!";
return 0;
}
else
{
//...................
}
GDALClose(poDataset);
return 0;
}
//---------------------------------------------//
Is there any detail that you need?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20090813/3804261a/attachment.html
More information about the gdal-dev
mailing list