   SDL_Image
  I'm having trouble loading a '*.png' file to my surface. I was using lazy foo's tutorials and I've also checked other sources and the code seems pretty sound, I don't know why the image isn't loading onto the surface. I even copy pasted from his tutorial, and it still doesn't seem to load. Can someone help me figure out what's wrong?Here is the code snippet://The headers#include "SDL/SDL.h"#include "SDL/SDL_image.h"#include <string>//The surfacesSDL_Surface *image = NULL;SDL_Surface *screen = NULL;SDL_Surface *load_image( string filename ){    //The image that's loaded    SDL_Surface* loadedImage = NULL;    //The optimized image that will be used    SDL_Surface* optimizedImage = NULL;    //Load the image using SDL_image    loadedImage = IMG_Load(filename.c_str());    //If the image loaded    if( loadedImage != NULL )    {   cout<<"Image load successful"<<endl; //Create an optimized image   optimizedImage = SDL_DisplayFormat( loadedImage );   //Free the old image   SDL_FreeSurface( loadedImage );    }    //Return the optimized image    return optimizedImage;}   
  Try printing the value of IMG_GetError() when IMG_Load() returns NULL, This should give you some clues as to what is (or isn't) going on.   ;  it says the file could not be found, but I have the file in the same folder as my project, also, I can load *.bmp's I just seem to have trouble with *.png's.   ;  Are the bitmaps that you can load located in the same directory as the pngs you cannot load? Have you tried using an absolute path?If that fails, can you include the exact error message that IMG_GetError() returns. Also, can you tell us what DLLs you have in your executable directory.   ;  everything is all in one folder, including the .dlls such as SDL.dll and SDL_image.dll.Everything compiles and it runs, but I have the program set to close if anything goes wrong. I've checked all problems like initialization problems and syntax problems and everything seems to be fine except that the image doesn't load properly. "Failed loading libpng12-0.dll: The specified module could not be found."^that's the error message   ;  You should have libpng<version>.dll when you downloaded SDL_Image. If not, download it again. SDL_Image supports lots of formats, but it relies on the DLLs for the formats you want to support being present.   ;  thanks! I put the libpng.dll in there and it started working.   