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

Author Topic: Problem with sf::Event  (Read 2348 times)

0 Members and 1 Guest are viewing this topic.

dusan

  • Newbie
  • *
  • Posts: 12
    • View Profile
Problem with sf::Event
« on: May 24, 2012, 08:15:14 pm »
Hello,
I have just started using sfml 2.0. I set up everything, copy some code, paste it when I try to run i got this error :
Error   1       error C2079: 'Event' uses undefined class 'sf::Event'   c:\users\NAME\documents\visual studio 2010\projects\sfml test application\sfml test application\main.cpp        12
 
Problem is about sf::Event and I cannot do much without that class.
Here is print screen:

Do you know what is the problem.
ps.
I am not shure is this topic in right section.
pss.
Search didnt help about this.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Problem with sf::Event
« Reply #1 on: May 24, 2012, 11:50:22 pm »
Is this the SFML 2rc?

Also how did you setup your project?
« Last Edit: May 24, 2012, 11:54:43 pm by eXpl0it3r »
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

dusan

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Problem with sf::Event
« Reply #2 on: May 25, 2012, 09:51:06 am »
I had a problem setting it and solution that worked for me is with CMake and SFML 2.0 snapshot then build debug and release in msvc++, then link them with project and put all dll's into folder with .exe file.
I dont know is it 2rc.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Problem with sf::Event
« Reply #3 on: May 25, 2012, 10:45:40 am »
If you've downloaded the latest source from GitHub then you've got the Release Candidate.
Your building steps sound good, did you follow the tutorial when setting up VS?

Try to rename Event to something else.

The problem is that MSVC doesn't find the declaration of sf::Event although you include Graphics.hpp, which includes Window.hpp, which includes Event.hpp.
If you follow the tutorial step by step it should work. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

dusan

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Problem with sf::Event
« Reply #4 on: May 25, 2012, 11:06:31 am »
Already did all stuff that you wrote - nothing helped. And yes I followed tutorial.
But when I downloaded SFML 2.0 snapshot and extract it at the end it give me some error :
!   C:\Users\NAME\Desktop\LaurentGomila-SFML-2.0-rc-24-gac9bda5.tar.gz: Cannot open Versions\Current\Resources (LaurentGomila-SFML-ac9bda5\extlibs\libs-osx\Frameworks\sndfile.framework\Resources --> Versions\Current\Resources)
!   C:\Users\NAME\Desktop\LaurentGomila-SFML-2.0-rc-24-gac9bda5.tar.gz: Symbolic link points to missing file
 
I have just ignored but now it come on my mind.
Could this be problem ?

dusan

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Problem with sf::Event
« Reply #5 on: May 25, 2012, 12:00:31 pm »
I found what is wrong.
Lock thread.

If you are interested or have this or similar problem all you have to do is
#include <SFML/Window/Event.hpp>

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Problem with sf::Event
« Reply #6 on: May 25, 2012, 12:13:43 pm »
I wouldn't consider this problem solved, because, like eXpl0it3r said:
Quote
The problem is that MSVC doesn't find the declaration of sf::Event although you include Graphics.hpp, which includes Window.hpp, which includes Event.hpp.
You should check that in your SFML headers.
Laurent Gomila - SFML developer