deadpickle wrote:
I have finally compiled my C program and tried running it for the
first time. When I ran the file I got the error:
[t...@updraft ~/Programs]$ ./gdal_test_convert
ERROR 10: Pointer 'hDriver' is NULL in 'OGR_Dr_CreateDataSource'.
I'm trying to load the ESRI Shapefile driver. When I compiled it I
linked it to the libgdal.a library. Is there something I'm missing?

#include "ogr_api.h"
#include "ogr_srs_api.h"
#include "stdio.h"
...

        //~ get driver and create ds
        driver = OGRGetDriverByName("ESRI Shapefile");
        ds = OGR_Dr_CreateDataSource(driver, "testc.shp", NULL);

Dead Pickle,

I believe you need to call OGRRegisterAll() before calling the get driver
function.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmer...@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to