<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to 46: CPPUnit don't support dynamic_cast?</title><link>https://sourceforge.net/p/cppunit/support-requests/46/</link><description>Recent changes to 46: CPPUnit don't support dynamic_cast?</description><atom:link href="https://sourceforge.net/p/cppunit/support-requests/46/feed.rss" rel="self"/><language>en</language><lastBuildDate>Tue, 29 Mar 2005 05:30:34 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/cppunit/support-requests/46/feed.rss" rel="self" type="application/rss+xml"/><item><title>CPPUnit don't support dynamic_cast?</title><link>https://sourceforge.net/p/cppunit/support-requests/46/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Hi:&lt;br /&gt;
When I use dynamic_cast cast base_class to &lt;br /&gt;
derive_class. the program will print following message&lt;br /&gt;
"uncaught exception of type __non_rtti_object &lt;br /&gt;
-Access violation - no RTTI data!"&lt;br /&gt;
How can I resovle this problem.&lt;/p&gt;
&lt;p&gt;I show the files PayrollTest.h and main.h as following&lt;/p&gt;
&lt;p&gt;//PayrollTest.h&lt;br /&gt;
class PayrollTest: public CPPUNIT_NS::TestFixture&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
//  PayrollTest (std::string name) : TestFixture (name) {}&lt;/p&gt;
&lt;p&gt;virtual void setUp();&lt;br /&gt;
virtual void teardown();&lt;/p&gt;
&lt;p&gt;protected:&lt;br /&gt;
void TestAddSalariedEmployee();&lt;/p&gt;
&lt;p&gt;private:&lt;br /&gt;
CPPUNIT_TEST_SUITE(PayrollTest);&lt;br /&gt;
CPPUNIT_TEST(TestAddSalariedEmployee);&lt;br /&gt;
CPPUNIT_TEST_SUITE_END();&lt;br /&gt;
};&lt;br /&gt;
CPPUNIT_TEST_SUITE_REGISTRATION(PayrollTest);&lt;/p&gt;
&lt;p&gt;//main.h&lt;br /&gt;
int main()&lt;br /&gt;
{&lt;br /&gt;
CPPUNIT_NS::TestResult r;&lt;br /&gt;
CPPUNIT_NS::TestResultCollector result;&lt;br /&gt;
r.addListener( &amp;amp;result );&lt;/p&gt;
&lt;p&gt;CPPUNIT_NS::TestFactoryRegistry::getRegistry).makeT&lt;br /&gt;
est()-&amp;gt;run( &amp;amp;r );&lt;br /&gt;
CPPUNIT_NS::TextOutputter out( &amp;amp;result, std::cout );&lt;br /&gt;
out.write();&lt;br /&gt;
return 0;&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;Thanks in advance&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Tue, 29 Mar 2005 05:30:34 -0000</pubDate><guid>https://sourceforge.net1838b12e15bfb0f6e900da28b884920baaa76dc3</guid></item></channel></rss>