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

Author Topic: Texture::loadFromFile always fails  (Read 885 times)

0 Members and 1 Guest are viewing this topic.

betawarz

  • Newbie
  • *
  • Posts: 3
    • View Profile
Texture::loadFromFile always fails
« on: December 17, 2013, 01:00:41 am »
I'm compiling code with Visual Studio 2013 and SFML 2.1. The code compiles, and runs, but Texture::loadFromFile always returns false. I've tried feeding it a relative path to the working directory, an absolute path directory to a png file, and neither seem to work. Is there a way I can see exactly what it's trying to load or the error message as to why it's failing? I can't figure out how to use sf::err() to read error messages.

Thanks!

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Texture::loadFromFile always fails
« Reply #1 on: December 17, 2013, 01:08:12 am »
If not redirected sf::err will write to std::err which in Windows is usually the console. But if you build a window application and deactivate the console, you won't get to see the output. So you'll end up with the following three options:
  • Build a command line application, so you'll get the console again.
  • Redirect sf::err in code, see the documentation for details.
  • Redirect the std::cerr from outside, by starting the application from the command line and adding myexe.exe 2> err.log.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/