SFML community forums

Help => Graphics => Topic started by: babichila on April 30, 2023, 08:56:59 pm

Title: Can't load texture from file
Post by: babichila on April 30, 2023, 08:56:59 pm
I tried to load texture from file. I  tryed everething:
I used just name of file, and checking directory in VS project settings
I used full path of file and write it in different ways, such as "D://folder//folder//file", "D:/folder/folder/file",
"D:\folder\folder\file"
I checked path over 10 times, all names are wright.
I was moving these file in different folders.
When i use full path, it writes me "Failed to load image "". Reason: Unable to open file" like it cant reads it's name.
When i use only filename, it says me: Failed to load image "@■Yd╨☺no_texture1.png☼☼╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠А╨► ☺r◄│9Ў⌂►↓└э█ ☺╪\♀♂♥є☼╘╔·⌂Т+·⌂▓9Ў⌂╨☻☺кми°^М╛\Device\HarddiskVolume6\Visual_Studio\VS_projects\Space_Rush\x64\Debug\Space_Rush.exe☺☺♦С+·⌂а∙^М╛╨☺♥р∙^МB╠·⌂ЁЛК¤9Ў⌂♦vБ╩·⌂░aМ╛б&B╠·⌂0√  ш♦0√  ╨♦↓
and same trash symbols. Also, it throws exception in asembler file "memcpy.asm"
I disabled option "Hide extensions for known file types".
Please, help me!
Title: Re: Can't load texture from file
Post by: G. on April 30, 2023, 09:57:37 pm
Trash symbol in the console when you load a texture is most likely that you're mixing release library with debug compilation. (or vice versa)

If you want to compile in release mode, use the release version of the lib (sfml-graphics etc.)
If you want to compile in debug mode, use the debug version of the lib (sfml-graphics-d etc.)
As written in the VS tutorial (https://www.sfml-dev.org/tutorials/2.5/start-vc.php)
Title: Re: Can't load texture from file
Post by: babichila on April 30, 2023, 10:14:36 pm
Trash symbol in the console when you load a texture is most likely that you're mixing release library with debug compilation. (or vice versa)

If you want to compile in release mode, use the release version of the lib (sfml-graphics etc.)
If you want to compile in debug mode, use the debug version of the lib (sfml-graphics-d etc.)
As written in the VS tutorial (https://www.sfml-dev.org/tutorials/2.5/start-vc.php)
It solved the problem! Thank you very match!