Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Zerima

Pages: [1]
1
I went to the configuration manager and changed the "active solution configuration" from debug to release and it's working.

Edit: The active solution configuration can actually be either debug or release, but the "configuration" for the project has to be on release.

2
If the working directory in the debugging settings tab is also set to $(SolutionDir)$(Configuration)\, then it's not a mystery why the resources can't be found.
Resources are searched relative to the working directory and the $(Configuration) part means, that the dir will be set to the Debug or Release sub-directory depending on the configuration you've currently selected.
It is not the same, but it still takes me to the same folder regardless when I hit browse.

3
I don't see an exe in the directory you screenshotted, so is that really the output directory?
When I click the drop down arrow then browse it takes me to that folder I screenshotted in my first post.

4
What is your working directory set to?
If you're talking about the one that is configuration properties -> debugging it's the same as the output directory / intermediate directory.

5
From what I've read the image should be in the output directory / intermediate directory(check attachment) and the image is indeed in the correct location.

I have also rechecked the property settings with the sfml setup tutorial and they are correct too and I've tried changing the image to a png and bmp, but still getting the same error.

       
sf::Texture backGround;
if (!backGround.loadFromFile("game.jpg"))
{
        std::cout << "Failed to load image." << std::endl;
        return -1;
}
 

I've also tried using loadFromStream and it doesn't work either.

sf::FileInputStream test;
test.open("game.jpg");
sf::Texture backGround;
if (!backGround.loadFromStream(test))
{
        std::cout << "Failed to load image." << std::endl;
        return -1;
}
 

Pages: [1]