Question: I am trying to use the GDAL Lib to read a ShapeFile (.shp). I followed the instructions of <http://www.gdal.org/ogr_apitut.html> - But it doesn't work!

```
#include <gdal_priv.h>
#include <ogrsf_frmts.h>

int main()
{
GDALAllRegister();

GDALDataset       *poDS;   
poDS = (GDALDataset*) GDALOpenEx( "point.shp", GDAL_OF_VECTOR, NULL, NULL, NULL );
}

```

The error message is that "GDALOpenEx()" is a undeclared identifier. Also "GDAL\_OF\_VECTOR" is not declared. 

How do I access the GDALOpenEx() method?
Do I have to load some drivers? (Which I thought GDALAllRegister() would do)

I am using xCode 6 on Mac OS 10.10. GDAL 1.11 from <http://www.kyngchaos.com/software:frameworks>

Answer: 
That solved my problem. 

Further information and a tutorial can be found here <http://gdal.org/1.11/ogr/ogr_apitut.html>

A C++ version for GDAL 1.11:

```
#include <GDAL/ogrsf_frmts.h>
int main()
{
OGRRegisterAll();
OGRDataSource   *poDS;
poDS = OGRSFDriverRegistrar::Open( "data.shp", FALSE);
}

```
If you look at [this](http://www.gdal.org/gdal_8h.html#aca05455472359964151f9c891d678d5e) and [this](http://www.gdal.org/gdal_8h.html#a8253249767721c3e54a4a2844b30f256), they say that both `GDALOpenEx()` and `GDAL_OF_VECTORS` were (will be?) introduced in GDAL 2.0. 

GDAL 2.0 seems to be still under development. In case that you are able to compile it, you can find the source code [here](https://svn.osgeo.org/gdal/trunk/gdal/).

In older versions you would use [OGROpen](http://www.gdal.org/ogr__api_8h.html#a2da3630231780d519543d1679c83e62f) to read a Shapefile.