I've been trying to load an image and i'm getting this error , my working directory is D:/Shipgame and in that folder i have a folder called imagenes then inside of that folder i have my image stored so i don't know why I'm getting this error since I'm giving the correct path.
this is my code so far.
#include <SFML/Window.hpp>
#include <iostream>
#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(800, 600), "SHIPWARS",sf::Style::Titlebar| sf::Style::Close);
sf::Texture imagen;
sf::Sprite fondo(imagen);
imagen.loadFromFile("imagenes/HubbleLegacyField.jpg");
// run the program as long as the window is open
while (window.isOpen())
{
// check all the window's events that were triggered since the last iteration of the loop
sf::Event event;
while (window.pollEvent(event))
{
// "close requested" event: we close the window
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.draw(fondo);
window.display();
}
return 0;
}