Subscribing to an event compile error

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

dmail
Quite a regular
Quite a regular
Posts: 46
Joined: Mon Nov 27, 2006 16:49

Subscribing to an event compile error

Postby dmail » Mon Jan 12, 2009 15:37

I am unable to subscribe to an event using template member function.

Code: Select all

   w->subscribeEvent( PushButton::EventClicked, Event::Subscriber( &Options_gui::activate<GRAPHICS>, this ) );

Generates
Error 3 error C2661: 'CEGUI::SubscriberSlot::SubscriberSlot' : no overloaded function takes 2 arguments

Code: Select all

      w->subscribeEvent( PushButton::EventClicked, Event::Subscriber(  MemberFunctionSlot<Options_gui>( &Options_gui::activate<GRAPHICS>, this ) ) );

Generates
error C2665: 'CEGUI::MemberFunctionSlot<T>::MemberFunctionSlot' : none of the 2 overloads could convert all the argument types
with
[
T=LVD::Options_gui
]
g:\projects\devjau_lvd_svn\branches\wip\dependencies\cegui-0.6.1_lvd\include\ceguimemberfunctionslot.h(48): could be 'CEGUI::MemberFunctionSlot<T>::MemberFunctionSlot(bool (__thiscall LVD::Options_gui::* )(const CEGUI::EventArgs &),T *)'
with
[
T=LVD::Options_gui
]
while trying to match the argument list '(overloaded-function, LVD::Options_gui *const )'


I have had a look at similar errors found with a search in the forum, but none are related to template member functions. I am sure this is not an error on my behalf, can someone confirm if this is a limitation of the library, a bug or a compiler bug.
Using visual studio 2005 sp1.
Thanks

dmail
Quite a regular
Quite a regular
Posts: 46
Joined: Mon Nov 27, 2006 16:49

Postby dmail » Mon Jan 12, 2009 15:58

Hmm well a full rebuild of my project fixed the error. :)

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Mon Jan 12, 2009 21:45

:D


Return to “Help”

Who is online

Users browsing this forum: No registered users and 15 guests