I have recently started using SFML on Visual c++ 2010. I have linked all of the libraries and included all of the required files but still when I run my "main.cpp" the compiler throws an Unhandled Exception i.e.
Unhandled exception at 0x00000000 in SFML.exe: 0xC0000005: Access violation executing location 0x00000000.
My program:
#include <SFML/Graphics.hpp>
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;
}
User contributions licensed under CC BY-SA 3.0