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

Author Topic: Sfml crahses on Image::LoadFromFile  (Read 7740 times)

0 Members and 1 Guest are viewing this topic.

Laguna

  • Newbie
  • *
  • Posts: 11
    • View Profile
Sfml crahses on Image::LoadFromFile
« on: November 05, 2008, 10:34:20 am »
Hi,
My Program crashes every time, i try to use the named method.
along with the crash the console writes cryptic letters and my pc mainboard speaker creates awful "beeps"

The Data is in the given position and the image and the sprite are properly initialized. (image::create works fine)

I'm using Visual studio 2008

Any intentions?

So Far...

Laguna!

bullno1

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Sfml crahses on Image::LoadFromFile
« Reply #1 on: November 06, 2008, 10:21:11 am »
I have this mysterious error once. First, I see the message could not load (image file name), then a lot of garbage appear on my console like it's dumping the image as ASCII. I tried to use a debug version of sfml but the call stack lead me to SOIL. Since I don't know much about it, i just find a work around.

That time my texture cache was using sf::Image in a map. After I change my code to use pointer to image (sf::Image*), everything works. However, I need to manually call new and delete on sf::Image

Mike

  • Newbie
  • *
  • Posts: 3
    • View Profile
Sfml crahses on Image::LoadFromFile
« Reply #2 on: November 11, 2008, 10:44:50 pm »
Im getting this same error. I took the exact code from the tutorial http://www.sfml-dev.org/tutorials/1.3/graphics-sprite.php and I made sure its a console program and put my image in the same directory as the .exe and i still get the Image cant load in the console.

Im also using the VS 2008.

CerealKlr

  • Newbie
  • *
  • Posts: 4
    • View Profile
Sfml crahses on Image::LoadFromFile
« Reply #3 on: November 11, 2008, 10:52:26 pm »
@Bull:
Can you elaborate on your fix? I tried initializing it with sf::Image* as the type and I got an error... >.<

EDIT:
Dunno if it has any improtance, but everything in the shape family works just fine...

Wizzard

  • Full Member
  • ***
  • Posts: 213
    • View Profile
Sfml crahses on Image::LoadFromFile
« Reply #4 on: November 11, 2008, 11:13:05 pm »
I think that he was saying that he couldn't get sf::Images contained in a std::map without making them pointers.

That isn't relevant to your situation though, is it?

CerealKlr

  • Newbie
  • *
  • Posts: 4
    • View Profile
Sfml crahses on Image::LoadFromFile
« Reply #5 on: November 11, 2008, 11:29:43 pm »
Well, the first paragraph of his post certainly applied (although on close examination of the contents of the console, it seems to be outputting information on Windows to me 0.o Thrown in are a several random ANSII symbols and a scattering of absolute file paths).

Damnit, I gotta get this damn AI recoded before the 15th... I didn't realize transitioning back into C++ would be so difficult, but then, I never bothered with anything besides Console programs before...

More random info:
-Running as a Win32 Console Program
-OS: Vista x64 Home Premium
-Using SFML 3.1
-Using  VC++ 2008 Express

EDIT:
Damn it all to hell, I can't draw text either, it just crashes... >.< Also tried drawing in OpenGL, which just crashes. Mildly depressing, I really thought SFML lived up to its name in simplicity... :(

Anyone else out their w/ Vista x64, Vista x32, or XP x64 having these problems? Could it be OS/bit specific?

Mike

  • Newbie
  • *
  • Posts: 3
    • View Profile
Sfml crahses on Image::LoadFromFile
« Reply #6 on: November 12, 2008, 12:01:08 am »
Im using xp 32bit and its not working for me.

CerealKlr

  • Newbie
  • *
  • Posts: 4
    • View Profile
Sfml crahses on Image::LoadFromFile
« Reply #7 on: November 12, 2008, 02:21:21 am »
damnit :( Same exact problems or jsut similar? (i.e. gigantic stream of ANSII symbols/cryptic phrases on Image.LoadFromFile(), crash on OpenGL and crash on Text drawing?).

CerealKlr

  • Newbie
  • *
  • Posts: 4
    • View Profile
Sfml crahses on Image::LoadFromFile
« Reply #8 on: November 12, 2008, 04:52:50 am »
Bleh... I pulled out the SDK copy I DLed and traced the problems back file to laborious file. Everything I understood seemed fine... The only important data I gleaned was that Images are ANSII Character Arrays, which may account for the spam in the console, assuming that the images are being dumped. Errors are taken from the same return as the images are (if I read the code right) which makes that somewhat plausible. I couldn't find the error message when I looked though. Will have to scan it more in depth tommorow I guess...

Damnit, I need this to work! >.<

Mike

  • Newbie
  • *
  • Posts: 3
    • View Profile
Sfml crahses on Image::LoadFromFile
« Reply #9 on: November 13, 2008, 12:28:00 am »
Heres what the console displays for me for when I'm trying to load an image.



I haven't tried opengl or text drawing.

EDIT:
Ok im sorry i looked on the forum and saw the same topic and they said to put these files in the directory if your using debug mode.
sfml-window-d.dll
sfml-system-d.dll
sfml-graphics-d.dll

I did that and the image showed up. :)

bullno1

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Sfml crahses on Image::LoadFromFile
« Reply #10 on: November 14, 2008, 02:49:39 pm »
Silly me  :( . So that's what actually fixed my problem.