subscribeEvent produces error C2064

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

pighead10
Just popping in
Just popping in
Posts: 8
Joined: Fri Jan 21, 2011 15:43

subscribeEvent produces error C2064

Postby pighead10 » Sun Sep 11, 2011 11:50

Code: Select all

guiRoot->getChild("Root/AddMiner")->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(&GameState::addMiner));


This line produces an error:

Code: Select all

c:\cegui\cegui\include\CEGUIFunctorCopySlot.h(51): error C2064: term does not evaluate to a function taking 1 arguments


Here is the function `GameState::addMiner`:

Code: Select all

void GameState::addMiner(const CEGUI::EventArgs &evt){
   player1Mgr->trackUnit(player1Mgr->getFaction()->getMiner());
}


It produces that error, and I've no idea why. please say if you need more details!

Here is the error in its entirety:

Code: Select all

c:\cegui\cegui\include\CEGUIFunctorCopySlot.h(51): error C2064: term does not evaluate to a function taking 1 arguments
1>          c:\cegui\cegui\include\CEGUIFunctorCopySlot.h(50) : while compiling class template member function 'bool CEGUI::FunctorCopySlot<T>::operator ()(const CEGUI::EventArgs &)'
1>          with
1>          [
1>              T=void (__thiscall GameState::* )(const CEGUI::EventArgs &)
1>          ]
1>          c:\cegui\cegui\include\CEGUISubscriberSlot.h(126) : see reference to class template instantiation 'CEGUI::FunctorCopySlot<T>' being compiled
1>          with
1>          [
1>              T=void (__thiscall GameState::* )(const CEGUI::EventArgs &)
1>          ]
1>          GameState.cpp(40) : see reference to function template instantiation 'CEGUI::SubscriberSlot::SubscriberSlot<void(__thiscall GameState::* )(const CEGUI::EventArgs &)>(const T &)' being compiled
1>          with
1>          [
1>              T=void (__thiscall GameState::* )(const CEGUI::EventArgs &)
1>          ]

maori
Just can't stay away
Just can't stay away
Posts: 161
Joined: Tue Sep 23, 2008 13:05
Location: Plumstead , UK

Re: subscribeEvent produces error C2064

Postby maori » Sun Sep 11, 2011 14:38

heya

try

Code: Select all

guiRoot->getChild("Root/AddMiner")->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(&GameState::addMiner, this));
trying to upgrade to 0.8.2 from 0.7.9 :D

pighead10
Just popping in
Just popping in
Posts: 8
Joined: Fri Jan 21, 2011 15:43

Re: subscribeEvent produces error C2064

Postby pighead10 » Sun Sep 11, 2011 15:29

It doesn't like it, "no instance of CEGUI::SubscriberSlot::SubscriberSlot matches the argument list"

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: subscribeEvent produces error C2064

Postby Kulik » Sun Sep 11, 2011 15:50

Code: Select all

void GameState::addMiner(const CEGUI::EventArgs &evt){


should be

Code: Select all

bool GameState::addMiner(const CEGUI::EventArgs &evt){

pighead10
Just popping in
Just popping in
Posts: 8
Joined: Fri Jan 21, 2011 15:43

Re: subscribeEvent produces error C2064

Postby pighead10 » Sun Sep 11, 2011 15:57

Thanks!


Return to “Help”

Who is online

Users browsing this forum: No registered users and 5 guests