Did you try using the absolute path?
I did the following:
// TIMBER4.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <SFML/Graphics.hpp>
#include <iostream>
using namespace sf;
int main()
{
system("dir");
//Creating object 'vm' of 'VideoMode' class
VideoMode vm(1280, 720);
//Creating object 'window' of 'RenderWindow' class
RenderWindow window(vm, "TIMBER", Style::Default);
//Setting texture
Texture textureBackground;
if (!textureBackground.loadFromFile("graphics/background.png"))
{
std::cout << "ERROR";
}
//Create Sprite and attach a Texture
Sprite spriteBackground;
spriteBackground.setTexture(textureBackground);
spriteBackground.setPosition(0, 0);
while (window.isOpen())
{
if (Keyboard::isKeyPressed(Keyboard::Escape))
{
window.close();
}
}
window.clear();
//window.draw(spriteBackground);
window.display();
return 0;
}
Result? Printed out DIR (it's OK so far I can say) and did not print our "ERROR" message. Does it mean that the texture.loadFromFile successfully loaded a texture from the file?
If so, I don't understand why I'm getting the error. If the line '//window.draw(spriteBackground);' is not commented out, the error LNK2001 (unresolved external symbol) appears with message: 'Severity Code Description Project File Line Suppression State
Error LNK2001 unresolved external symbol "public: static class sf::RenderStates const sf::RenderStates::Default" (?Default@RenderStates@sf@@2V12@B)'. So far I understand - the draw fce is not able to process the argument Sprite, am I right?
If so, why is that happening?