Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Events have anonymous unions?!  (Read 5492 times)

0 Members and 1 Guest are viewing this topic.

theanzelm

  • Newbie
  • *
  • Posts: 7
    • View Profile
Events have anonymous unions?!
« 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'

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Events have anonymous unions?!
« Reply #1 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]
Laurent Gomila - SFML developer

theanzelm

  • Newbie
  • *
  • Posts: 7
    • View Profile
Events have anonymous unions?!
« Reply #2 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

theanzelm

  • Newbie
  • *
  • Posts: 7
    • View Profile
Events have anonymous unions?!
« Reply #3 on: March 05, 2008, 04:32:27 pm »
this is really strange:

Event.Key.Code

works for example only the MouseMove not

theanzelm

  • Newbie
  • *
  • Posts: 7
    • View Profile
Events have anonymous unions?!
« Reply #4 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!

 

anything