As the title says i get an error when i try to run this
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <SFML/System.hpp>
#include <SFML/Audio.hpp>
int main()
{
float spritePosX = 50;
float spritePosY = 50;
sf::Music music;
if(!music.openFromFile("music.ogg"))
{
return -1;
}
music.play();
sf::RenderWindow window(sf::VideoMode(640, 480), "SFML test");
sf::CircleShape shape(100.f);
shape.setFillColor(sf::Color::Green);
//Fixing texture
sf::Texture texture;
if(!texture.loadFromFile("wood.png"))
{
return EXIT_FAILURE;
}
texture.setSmooth(true);
texture.setRepeated(false);
//Fixing sprite
sf::Sprite sprite;
sprite.setTexture(texture);
sprite.setColor(sf::Color::Green);
sprite.setPosition(sf::Vector2f(spritePosX, spritePosY));
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
if(event.type == sf::Event::KeyPressed)
{
if(event.key.code == sf::Keyboard::Up)
{
sprite.move(0, -5);
}
if(event.key.code == sf::Keyboard::Down)
{
sprite.move(0, 5);
}
if(event.key.code == sf::Keyboard::Left)
{
sprite.move(-5, 0);
}
if(event.key.code == sf::Keyboard::Right)
{
sprite.move(5, 0);
}
if(event.key.code == sf::Keyboard::R)
{
sprite.setColor(sf::Color::Red);
}
if(event.key.code == sf::Keyboard::G)
{
sprite.setColor(sf::Color::Green);
}
if(event.key.code == sf::Keyboard::B)
{
sprite.setColor(sf::Color::Blue);
}
if(event.key.code == sf::Keyboard::Y)
{
sprite.setColor(sf::Color::Yellow);
}
}
}
window.clear();
window.draw(sprite);
window.display();
}
return 0;
}
When i try to run it it says it cant start the program and then (0xc000007b)
When i check output from debug it says
The program '[8204] SFML 2.1 game.exe' has exited with code -1073741701 (0xc000007b).
I have no clue whats going on