Hello everyone, I am trying to load an image into my program that is using SDL, OpenGL, and SDL_image to load images. But for some reason IMG_Load() always returns a null pointer, no matter what. Even SDL_LoadBMP() returns a null pointer. I have the DLLs and the images in with my executable.
Here is a codeblock:
SDL_Surface *test = IMG_Load("test.png");
std::cout << "test=" << test << " Reason: " << SDL_GetError() << std::endl;
Here is it's output:
test=00000000 Reason: Couldn't open test.png
If I try to load test.bmp with SDL_LoadBMP() I get the same results, with the obvious change of png to bmp. I am sure the pictures are there.
I am using Microsoft Visual C++ 2008 Express
Here are my libraries that i have linked:
SDLmain.lib
SDL.lib
SDL_image.lib
opengl32.lib
glu32.lib
gdi32.lib
Here is part of my globals.h:
#include "SDL.h"
#include "SDL_main.h"
#include "SDL_image.h"
#include "SDL_opengl.h"
#include <gl.h>
#include <glu.h>
#include <glext.h>
I am running release mode because debug mode causes link errors with "__imp___CrtDbgReportW".
What am i doing wrong?
Thank you.
[Edited by - Hacktank on December 26, 2009 7:18:57 PM]