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

Author Topic: loadFromFile always returns false (SFML 2.5.1 64-bit)  (Read 1680 times)

0 Members and 1 Guest are viewing this topic.

SomeoneClearlyRetarded

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
loadFromFile always returns false (SFML 2.5.1 64-bit)
« on: March 10, 2019, 09:38:46 am »
I don't know if it's just me being retarded, but what ever I try SFML can never load anything for me

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10815
    • View Profile
    • development blog
    • Email
Re: loadFromFile always returns false (SFML 2.5.1 64-bit)
« Reply #1 on: March 10, 2019, 12:27:46 pm »
What's the output on the console?
What's your working directory?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

SomeoneClearlyRetarded

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: loadFromFile always returns false (SFML 2.5.1 64-bit)
« Reply #2 on: March 10, 2019, 10:43:36 pm »
Just some simple code.Directory Project1 Project1, the code just writes error if it is not able to load texture.
The crazy part is that it works flawlessly on the 32 bit library
« Last Edit: March 10, 2019, 10:46:14 pm by SomeoneClearlyRetarded »

Lucy2020

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: loadFromFile always returns false (SFML 2.5.1 64-bit)
« Reply #3 on: March 11, 2019, 02:19:46 pm »
Make sure you do it like this C:\\Users\\ and not C:/Users/

SomeoneClearlyRetarded

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: loadFromFile always returns false (SFML 2.5.1 64-bit)
« Reply #4 on: March 11, 2019, 02:56:13 pm »
Nope, still doesn't load

Hapax

  • Hero Member
  • *****
  • Posts: 3349
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: loadFromFile always returns false (SFML 2.5.1 64-bit)
« Reply #5 on: March 11, 2019, 05:19:10 pm »
The DLLs should not be with the source files; they should be next to the executables. For a default setup - for your particular project - they should be in Debug and Release folders inside C:/Users/Master/Desktop/Project1; that's for the 32-bit DLLs. The 64-bit DLLs should be in Debug and Release folders inside C:/Users/Master/Desktop/Project1/x64.
Note that the debug DLLs (with the extra -d) should be in the Debug folders and the release DLLs should be in the Release folders. Of course, the openal32 DLL should be in both debug and release.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

SomeoneClearlyRetarded

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: loadFromFile always returns false (SFML 2.5.1 64-bit)
« Reply #6 on: March 12, 2019, 07:04:12 pm »
Thanks a lot, that fixes a bunch of the problems. Could have sworn that I tried that before, but it didn't work, eh who knows, I'm dumb. But I'm still confused why only the Release version works, but the Debug version from VS still just doesn't load the file and from the exe asks me for the realease dll's

bovacu

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: loadFromFile always returns false (SFML 2.5.1 64-bit)
« Reply #7 on: March 18, 2019, 10:25:48 am »
I had this same issue. The first problem was like Hapax said, be carefull where you put your dll's or lib's. The other problem came with the linker, where you put all your sfml-system.lib... or with the -d or/and with -s. I mixed them and in some of them I put .lib and in others .dll, so that caused all my problems, you probably have read this, but here's the documentation for the linker and so:

https://www.sfml-dev.org/tutorials/2.5/start-vc.php

Review the linkers and the options you have put, hope it helps.