[Gdal-dev] how to write block by block to file

Pushkar Pradhan pushkar at GRI.MsState.Edu
Thu Jan 15 01:41:10 EST 2004


> What is poDriver?  Are you sure it isn't NULL?  dwtFile is a
> proper filename?
> Nothing to odd about imgXSize or imgYSize?  Assuming that poDriver is a
> driver supporting the create call (such as GeoTIFF) things should be fine.
Oops, poDriver was NULL, so now I do get the driver name but getting these
syntax errors:
Redstone[1316] pushkar$ g++ -g -o main
dwt-serial.cpp -Ierrs/ -Imisc/ -Iip/ -I../gdal-1.1.9/include/
../gdal-1.1.9/lib/libgdal.1.1.so
dwt-serial.cpp: In function `int main(int, char **)':
dwt-serial.cpp:61: request for member `GetDriverByName' in
`GetGDALDriverManager', which is of non-aggregate type `GDALDriverManager *
()()'

Here's the code:
  poDriver = (GDALDriver *)GetGDALDriverManager->GetDriverByName(pszFormat);
  if(poDriver == NULL)
    exit(EXIT_FAILURE);

  poDstDS = poDriver->Create(dwtFile, imgXSize, imgYSize, 1, GDT_Float32,
NULL);
  if(poDstDS == NULL)
    exit(EXIT_FAILURE);

Yes I checked through gdb img x size, ysize etc. are okay. Can you tell why
I'm getting those errors, I followed the documentation?
Pushkar




More information about the Gdal-dev mailing list