• Advertisement
Sign in to follow this  

SDL_image code suddenly stopped working.

This topic is 2013 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I don't understand what's going on, I have these same two images that have been in a minor little test project I have that were loaded and rendered to the screen. It worked when I last used it. Now today, probably a week or so later, I try to recompile it, it doesn't work. Same code, but I get an error that it's an unsupported image format. That's impossible. I used these images before, and they're simple jpg files.

This is how I loaded each image:


SDL_Surface* img = IMG_Load(file);


"file" is just part of a this function: GLuint LoadTexture(const char* file)

Well, I'm at a loss, I didn't change the code since last use, and it worked fine then. Just so you know, I'm running Linux Mint as my OS with Code::Blocks as my IDE.

Share this post


Link to post
Share on other sites
Advertisement
Ideas that first pop into mind are:
1. Did you somehow manage to install another version of SDL library on your system that gets linking priority?
2. Did you either change project settings or project failed to save properly last time you changed it?
3. Did you update Code::Blocks or gcc?

In other words, what might have been something else related, but not immediately obvious that you or something automated on your system might have done? Just to be safe, I'd try to open the JPG files with something else as it is the easiest thing to check and maybe they have become corrupt somehow.

Share this post


Link to post
Share on other sites
I don't recall installing another version of the SDL library, but I'll look into that, and I didn't alter the project settings, just the build options to link needed libraries. I also didn't update Code::Blocks or GCC.

Edit: Oh yeah, I have opened the JPG files. They appear to be perfectly normal. Edited by Spirrwell

Share this post


Link to post
Share on other sites
I am not entirely certain about how things work on *nix systems, but zlib or libjpg might also be somehow related to the problem.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement