yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #00635
reason of failing dynamic_casts
-
To:
Yade Development Group <yade-dev@xxxxxxxxxxxxxxxxxxx>
-
From:
Václav Šmilauer <eudoxos@xxxxxxxx>
-
Date:
Thu, 18 Sep 2008 18:56:27 +0200
-
User-agent:
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.16) Gecko/20080724 Lightning/0.8 Thunderbird/2.0.0.16 Mnenhy/0.7.5.666
Janek,
I finally found why dynamic_cast was failing on NormalShearInteraction
(remember? We had to put static_cast in GlobalStiffnessCounter just
before the .12 release). Well, the point is that every class that can be
cast to must have at least one virtual method defined in the .cpp file
(hence in the shared object); I assume that otherwise typeinfo is not
put at all into the plugin during linking or something like that, and
casting fails at runtime. If you have some idea on the real cause of
this, let me know.
I discovered this with SpheresContactGeometry that I changed. The
solution was to put at least the empty virtual descructor to the .cpp files.
I reverted the static_cast in GlobalStiffnessCounter and it works fine.
Regards, Vaclav