[Gdal-dev] need RTTI for OGR (Windows)

EllenD ellen.debeuckeleer at incgeo.be
Fri Apr 7 08:31:01 EDT 2006


Hi,

I want to perform a dynamic_cast on an OGRGeometry* object as follows:

OGRGeometry *poGeometry ....  // not null
...
switch (poGeometry->getGeometryType())
{
    .....
     case wkbPolygon:
         MyFunc( dynamic_cast<OGRPolygon *>(poGeometry));
         ....
}

MyFunc(OGRPolygon  *poPolygon)
{
.....
}


Running this code under Linux works fine, but under Visual Studio I get the
runtime following error:

Unhandled exception @ .... : Microsoft C++ exception: __non_rtti_object @
....

I am using GDAL 1.3.1 and tried to compile it with the /GR option added to
the OPTFLAGS compiler flags in nmake.opt. The compilation and installation
are successfull, but I still get the error. 

How can I compile GDAL so that OGR (and GDAL) has RTTI support or is
something else wrong?

Ellen



--
View this message in context: http://www.nabble.com/need-RTTI-for-OGR-%28Windows%29-t1411792.html#a3802726
Sent from the GDAL - Dev forum at Nabble.com.




More information about the Gdal-dev mailing list