<div>#include &quot;ogrsf_frmts.h&quot;</div><div><br></div><div>#include &lt;stdio.h&gt;</div><div><br></div><div>int main()</div><div>{</div><div>    const char *pszDriverName = &quot;ESRI Shapefile&quot;;</div><div>    OGRSFDriver *poDriver;</div>


<div><br></div><div>    OGRRegisterAll();</div><div> OGRDataSource       *poDS;</div><div><br></div><div>    poDS = OGRSFDriverRegistrar::Open( &quot;point_out.shp&quot;, FALSE );</div><div>    if( poDS == NULL )</div><div>


    {</div><div>       cout &lt;&lt;  &quot;Open failed.&quot;  &lt;&lt; endl;</div><div>   </div><div>    }</div><div><br></div><div>    OGRLayer  *poLayer;</div><div><br></div><div>    poLayer = poDS-&gt;GetLayerByName( &quot;point_out&quot; );</div>


<div><br></div><div>    OGRFeature *poFeature;</div><div><br></div><div>    poLayer-&gt;ResetReading();</div><div><br></div><div>        OGRGeometry *OLGeometry;</div><div> char *geom = &quot;POINT(6 10)&quot;;</div><div>


<br></div><div>        OLGeometry-&gt;importFromWkt(&amp;geom);</div><div>}</div><div><br></div><div>if the line   OLGeometry-&gt;importFromWkt(&amp;geom); is not included it works without segfault</div><div><br></div><div>


here is the code which creates the shapefile </div><div><br></div><div><div>const char *pszDriverName = &quot;ESRI Shapefile&quot;;</div><div>    OGRSFDriver *poDriver;</div><div><br></div><div>    OGRRegisterAll();</div>


<div><br></div><div>    poDriver = OGRSFDriverRegistrar::GetRegistrar()-&gt;GetDriverByName(</div><div>                pszDriverName );</div><div> </div><div>    OGRDataSource *poDS;</div><div><br></div><div>    poDS = poDriver-&gt;CreateDataSource( &quot;point_out.shp&quot;, NULL );</div>

<div> </div><div><br></div><div>    OGRLayer *poLayer;</div><div><br></div><div>    poLayer = poDS-&gt;CreateLayer( &quot;point_out&quot;, NULL, wkbPoint, NULL );</div><div>    OGRDataSource::DestroyDataSource( poDS );</div>


</div><div><br></div><br>-- <br>Rashad<br>