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

Chapman, Martin MChapman at sanz.com
Fri Apr 7 12:17:40 EDT 2006


Ellen,

Also,

The reason it ran under Linux is because GCC enables it by default.  The
reason Microsoft does not is because it creates bigger binaries, because
it includes the V-Table type info information and it's a slight
performance hit.  You can also use the older typeid() function to
perform rtti.

Martin

-----Original Message-----
From: gdal-dev-bounces at lists.maptools.org
[mailto:gdal-dev-bounces at lists.maptools.org] On Behalf Of EllenD
Sent: Friday, April 07, 2006 6:31 AM
To: gdal-dev at lists.maptools.org
Subject: [Gdal-dev] need RTTI for OGR (Windows)


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#a380
2726
Sent from the GDAL - Dev forum at Nabble.com.

_______________________________________________
Gdal-dev mailing list
Gdal-dev at lists.maptools.org
http://lists.maptools.org/mailman/listinfo/gdal-dev




More information about the Gdal-dev mailing list