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

Author Topic: texture.loadFromFile string not working  (Read 1293 times)

0 Members and 1 Guest are viewing this topic.

Cano321

  • Newbie
  • *
  • Posts: 2
    • View Profile
texture.loadFromFile string not working
« on: January 13, 2024, 12:34:35 am »
I'm trying to quickly see if texture loading for my project is working, but I'm having an odd issue. When I try to put in the file into texture.loadFromFile, I get the error file not found, but the file it's saying is not found is not the one I have for the string. For example if I put texture.loadFromFile("test.png"); I get the error "Failed to load image "". Reason: Unable to open file" Even stranger when I used "image.png" I got the error: "Failed to load image "É▒╔.image.png    ╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠". Reason: Unable to open file" And the characters sometimes change when I run it again. Other random strings give similar results.

If anyone knows of a solution help would be greatly appreciated

G.

  • Hero Member
  • *****
  • Posts: 1593
    • View Profile
Re: texture.loadFromFile string not working
« Reply #1 on: January 13, 2024, 12:58:23 am »
It's most likely that you mixed debug lib with release mode or mixed release lib with debug mode.
It is important to link to the libraries that match the configuration: "sfml-xxx-d.lib" for Debug, and "sfml-xxx.lib" for Release. A bad mix may result in crashes.

Cano321

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: texture.loadFromFile string not working
« Reply #2 on: January 13, 2024, 02:53:53 am »
yup that was the problem. Thanks so much for the help!