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

Author Topic: loadFromFile works only in Release on x64 version  (Read 1631 times)

0 Members and 1 Guest are viewing this topic.

JamesListener

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
loadFromFile works only in Release on x64 version
« on: August 08, 2016, 02:19:33 am »
Hello everyone.
I've got a problem with loading a picture.

loadFromFile always returns "false" (both on Image and Texture) in Debug mode, but works fine in Release.
And this is so on x64 version of library (of course I compile it under x64 platform).
If i take x86 version of sfml, it works fine in both Release and Debug modes.

I've found one topic on another forum, where some guy has got the same trouble, but he didn't get any good explanation. On this forum I didn't find similar questions.

What should I do to make it work in Debug mode?

Win10 x64, VS 2015 x64, SFML 2.3.2 64bit version.

Code is pretty simple:
Code: [Select]
Texture tileset;
if (tileset.loadFromFile("images/basic.png"))
printf("picture loaded");
else
printf("picture NOT loaded");
« Last Edit: August 08, 2016, 02:28:09 am by JamesListener »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
AW: loadFromFile works only in Release on x64 version
« Reply #1 on: August 08, 2016, 09:10:32 am »
Might just be that your working directory is set differently for x64 debug.
Where do you store the image? What's the working directory?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

JamesListener

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Re: loadFromFile works only in Release on x64 version
« Reply #2 on: August 08, 2016, 11:28:56 am »
Nope. Working Directory is set to Project folder. I've already checked it. And I even have copied "image" folder everywhere I could inside the solution. Still doesn't work.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
AW: loadFromFile works only in Release on x64 version
« Reply #3 on: August 08, 2016, 11:40:28 am »
Well what's the ouput on the console window?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

JamesListener

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Re: loadFromFile works only in Release on x64 version
« Reply #4 on: August 08, 2016, 11:50:55 am »
When I removed the picture and compiled code, I've got a message from cerr that image couldn't be opened. In Debug mode I've never get such a message.
Look:
1) Release, image removed:

2) Debug, image removed or image exists - doesn't matter:


JamesListener

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Re: loadFromFile works only in Release on x64 version
« Reply #5 on: August 08, 2016, 12:19:17 pm »
Sorry for my awful English... Not my native language...

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
AW: loadFromFile works only in Release on x64 version
« Reply #6 on: August 08, 2016, 05:33:46 pm »
Are you linking the debug libraries in debug mode (the ones with the -d suffix)?
Can you provide the full build command?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

JamesListener

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Re: loadFromFile works only in Release on x64 version
« Reply #7 on: August 08, 2016, 07:34:23 pm »
Oh. Right. I am an idiot.
OF COURSE I linked libs without -d.
Nice. Please, bombard me with rotten eggs. I deserve this.

Thanks a lot for helping me out.
Question is closed.
« Last Edit: August 08, 2016, 07:49:45 pm by JamesListener »