Statechart tutorial problem and possible solution
I am going through the tutorial for Statechart. Going through the section "adding reactions", while debug build links fine, in a release mode linker issues following complaints: 1>FSM.obj : error LNK2001: unresolved external symbol "public: void __thiscall boost::statechart::detail::no_context::no_function<struct EvReset>(struct EvReset const &)" (??$no_function@UEvReset@@@no_context@detail@statechart@boost@@QAEXABUEvReset@@@Z) 1>FSM.obj : error LNK2001: unresolved external symbol "public: void __thiscall boost::statechart::detail::no_context::no_function<struct EvStartStop>(struct EvStartStop const &)" (??$no_function@UEvStartStop@@@no_context@detail@statechart@boost@@QAEXABUEvStartStop@@@Z) I ended up adding following line to my cpp file: template< class Event > void sc::detail::no_context::no_function( const Event & ) {}; and it cured the linker complaint. Michael
Hi Michael
I am going through the tutorial for Statechart. Going through the section "adding reactions", while debug build links fine, in a release mode linker issues following complaints:
1>FSM.obj : error LNK2001: unresolved external symbol "public: void __thiscall boost::statechart::detail::no_context::no_function<struct EvReset>(struct EvReset const &)" (??$no_function@UEvReset@@@no_context@detail@statechart@boost@@QAEXABUEvReset@@@Z) 1>FSM.obj : error LNK2001: unresolved external symbol "public: void __thiscall boost::statechart::detail::no_context::no_function<struct EvStartStop>(struct EvStartStop const &)" (??$no_function@UEvStartStop@@@no_context@detail@statechart@boost@@QAEXABUEvStartStop@@@Z)
What compiler are you using?
I ended up adding following line to my cpp file:
template< class Event > void sc::detail::no_context::no_function( const Event & ) {};
and it cured the linker complaint.
That might be necessary under certain circumstances e.g. when portions of a FSM reside in a lib file. Are you doing something like that? Thanks & Regards, -- Andreas Huber When replying by private email, please remove the words spam and trap from the address shown in the header.
Andreas, Thank you for the quick response. Following are my answers: What compiler are you using? Visual Studio 2005 professional That might be necessary under certain circumstances e.g. when portions of a FSM reside in a lib file. Are you doing something like that? No, I simply created console app project and used cpp file generated by the project wizard to enter code from the tutorial. If you want me to I can e-mail you the complete source code for this test project. (tiny) I have additional questions pertinent to the StateChart library. Disclaimer: I am complete newbie in the areas of StateChart and FSM in general. Question 1: I am looking for the resource (user group, blog etc) where users of StateChart discuss the usage of this library. Where should I look for such a resourse beyong users group at boost? Question 2: I am using tutorial to create my own FSM on a scale similar to the Digital Camera example in the tutorial and I am having conceptual problems (or just lack of understanding base concepts). Is it possible for me to send you my implementation header file with questions embedded in the declarations? Best regards and thanks for the very powerful lib, Michael.
Michael wrote:
What compiler are you using? Visual Studio 2005 professional
Ok.
That might be necessary under certain circumstances e.g. when portions of a FSM reside in a lib file. Are you doing something like that? No, I simply created console app project and used cpp file generated by the project wizard to enter code from the tutorial. If you want me to I can e-mail you the complete source code for this test project. (tiny)
If it fits on one screen feel free to add it to your follow-up post. Otherwise, please try to reduce it. If there's no way to reduce it, feel free to email it to me. I can't give any guarantee that I'll have the time though.
I have additional questions pertinent to the StateChart library. Disclaimer: I am complete newbie in the areas of StateChart and FSM in general. Question 1: I am looking for the resource (user group, blog etc) where users of StateChart discuss the usage of this library. Where should I look for such a resourse beyong users group at boost?
There's no dedicated group. Post your questions to gmane.comp.lib.boost.user.
Question 2: I am using tutorial to create my own FSM on a scale similar to the Digital Camera example in the tutorial and I am having conceptual problems (or just lack of understanding base concepts). Is it possible for me to send you my implementation header file with questions embedded in the declarations?
If your questions have anything to do with Boost.Statechart, please post to the group. If not, please ask me by private email. Regards, -- Andreas Huber When replying by private email, please remove the words spam and trap from the address shown in the header.
participants (2)
-
Andreas Huber
-
Michael