#168 Generated C++ doesn't compile in VS2010


I just upgraded from 5.1.0 to 6.1.0 and code that was fine before no longer compiles.

There are many error messages like this one:

StartTick_sm.h(127): error C2512: 'statemap::FSMContext' : no appropriate default constructor available
Ticker.h(147): error C2259: 'core::CTickerContext' : cannot instantiate abstract class
due to following members:
'void statemap::FSMContext::enterStartState(void)' : is abstract
statemap.h(552) : see declaration of 'statemap::FSMContext::enterStartState'

The version of statemap.h with 6.1 is 1.17, previously I had v 1.7 of this file.


  • Anonymous - 2012-11-13

    "no appropriate default constructor available" means that at some point in your code you want to instantiate a FSMContext object before the copying can occur. This usecase is not intended, take look in statemap.h (1.17, line 787ff.): there's a private copy constructor with a long comment, just to prevent the us of a copy constructor.

    However, the assignment operator is overloaded, so you can copy a FSMContext, after it's been instantiated.

    To get a good understanding of the difference, see http://www.learncpp.com/cpp-tutorial/911-the-copy-constructor-and-overloading-the-assignment-operator/

  • Glenn Ramsey

    Glenn Ramsey - 2012-11-13

    I've had another try at this and I notice that the name of the context class has been changed. Couldn't reproduce the error I had initially, but after updating the name it now compiles. I'm wondering if I previously had some sort of version mixup with an earlier version of SMC.

  • Glenn Ramsey

    Glenn Ramsey - 2012-11-13
    • status: open --> open-invalid
  • Glenn Ramsey

    Glenn Ramsey - 2012-11-13
    • status: open-invalid --> closed-invalid

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks