Sign in to follow this  
moaid

SFML Unhandled Exception error (Visual Studio 2013)

Recommended Posts

moaid    120

hi so im using windows 8.1 with visual studio 2013 c++ and i installed sfml following http://www.sfml-dev.org/tutorials/2.2/start-vc.php in the exact way and i get an Unhandled Exception error 

the code that im trying to run is the simple example given at the bottom of the web page :

 

 

 

#include <SFML/Graphics.hpp>
using namespace sf;
int main()
{
sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
sf::CircleShape shape(100.f);
shape.setFillColor(sf::Color::Green);
 
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
 
window.clear();
window.draw(shape);
window.display();
}
 
return 0;
}

 

 

what am i doing wrong here ???

Share this post


Link to post
Share on other sites
Washu    7829
You're accessing a null pointer. Don't do that.

Don't know where, in your code, but maybe you didn't initialize something you were supposed to. Edited by Washu

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this