SFML community forums

Help => Window => Topic started by: theanzelm on March 03, 2008, 05:09:21 pm

Title: Events have anonymous unions?!
Post by: theanzelm on March 03, 2008, 05:09:21 pm
Hi!

I've got a problem (which seems to be mentioned in http://www.sfml-dev.org/forum/viewtopic.php?t=95):

When I call for example
Code: [Select]
sf::Event Event;
...
int i = Event.MouseMove.X;


My Compiler gives me the error:
Code: [Select]
object missing in reference to `sf::Event::<anonymous union>::MouseMove'
Title: Events have anonymous unions?!
Post by: Laurent on March 04, 2008, 02:26:17 am
Which compiler are you using ?

Did you use a "using namespace sf;" ? What if you name your variable Evt ?[/code]
Title: Events have anonymous unions?!
Post by: theanzelm on March 04, 2008, 06:31:00 pm
I'm using Dev-C++ which uses minGW which uses gcc i think.

No I'm not using sf namespace I always write sf::Event

variable name doesn't matter.

thanks for tips
Title: Events have anonymous unions?!
Post by: theanzelm on March 05, 2008, 04:32:27 pm
this is really strange:

Event.Key.Code

works for example only the MouseMove not
Title: Events have anonymous unions?!
Post by: theanzelm on March 05, 2008, 04:45:26 pm
aaahhh I'm so sorry the problem was somewhere else, i had

Event.type == sf::Event::MouseMove (without a "d" at the and)

 :oops:

really great lib!