Menu

Error when compiling with Helper Macros

Help
sabates81
2006-08-21
2013-04-22
  • sabates81

    sabates81 - 2006-08-21

    I am just starting my integration with CppUnit and would like to use the Helper Macros.  I have been able to create a Suite and Test Fixtures without the Macros just fine, but when I add the #include <cppunit/extensions/HelperMacros.h> into my file without even calling any of the Macros, I receive compiler errors.  I am using the CppUnit version 1.12 and I am compiling with MinGW.  The following are my errors:

    In file included from ../../lib/cppunit/include/cppunit/extensions/HelperMacros.
    h:12,
                     from vmfmessagelogUT.cpp:15:
    ../../lib/cppunit/include/cppunit/extensions/ExceptionTestCaseDecorator.h: In me
    mber function `void CppUnit::ExceptionTestCaseDecorator<ExpectedException>::runT
    est()':
    ../../lib/cppunit/include/cppunit/extensions/ExceptionTestCaseDecorator.h:73: er
    ror: `e' undeclared (first use this function)
    ../../lib/cppunit/include/cppunit/extensions/ExceptionTestCaseDecorator.h:73: er
    ror: (Each undeclared identifier is reported only once for each function it appe
    ars in.)
    ../../lib/cppunit/include/cppunit/extensions/ExceptionTestCaseDecorator.h:84: er
    ror: cannot use typeid with -fno-rtti
    ../../lib/cppunit/include/cppunit/extensions/ExceptionTestCaseDecorator.h:84: er
    ror: no matching function for call to `CppUnit::TypeInfoHelper::getClassName(<ty
    pe error>)'
    ../../lib/cppunit/include/cppunit/extensions/TypeInfoHelper.h:25: note: candidat
    es are: static std::string CppUnit::TypeInfoHelper::getClassName(const std::type
    _info&)
    mingw32-make: *** [tmp\obj\vmfmessagelogUT.o] Error 1

     
    • sabates81

      sabates81 - 2006-08-21

      After my posting, I discovered the answer to my problem.  It was really a QT setup issue.  QT was creating my makefile for my unit test with the "no-rtti" and "no-exceptions" commands.  This can be enabled by setting "CONFIG+= rtti exceptions" in the qmake options.  Hope that may help someone else.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.