-
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:
(http://img96.imageshack.us/img96/8585/slikadp.jpg)
Do you know what is the problem.
ps.
I am not shure is this topic in right section.
pss.
Search didnt help about this.
-
Is this the SFML 2rc?
Also how did you setup your project?
-
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.
-
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 (http://www.sfml-dev.org/tutorials/2.0/start-vc.php)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. ;)
-
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 ?
-
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>
-
I wouldn't consider this problem solved, because, like eXpl0it3r said:
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.