Sign in to follow this  

DevC++ and SDL_image problem

This topic is 4762 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

Using DevC++, I added -lSDL_image to the parameters of the linker. Although, evertything seems to be installed correctly (SDL_image 1.2.3 from devpaks.org), I get the following error message: ld.exe (...) cannot find -lSDL_image Does anyone know what's the problem? Regards, T.

Share this post


Link to post
Share on other sites
Nope, it's not.

The SDL_image file resided within the C:\Program Files\Dev-Cpp\Dll folder as the SDL.dll does, too.

However, I thought this is no point here, since I am trying to statically link to SDL?

Isn't the -lSDL_image flag supposed to link against the SDL_image.a library which is located in the C:\Program Files\Dev-Cpp\lib folder?

T.

Share this post


Link to post
Share on other sites
Quote:
Original post by TroneX
Isn't the -lSDL_image flag supposed to link against the SDL_image.a library which is located in the C:\Program Files\Dev-Cpp\lib folder?

the -lSDL_image flag links to libSDL_image.a library.
AFAIK SDL_image packadge from devpaks is broken. download its sources and build the binaries yourself or get mine ( here )

Share this post


Link to post
Share on other sites
Some time ago I also tried to do -lSDL_Image stuff in DevC++ but it didn't worked. Then I tried explicitly saying where that lib is stored through full pathname (Project settings -> Parameters -> Linker) and now it's working.

Share this post


Link to post
Share on other sites
Quote:
Original post by happybara
Download its sources and build the binaries yourself or get mine ( here )

Thanks a bunch, I used your package along with putting the -lSDL_image flag in the Project -> Project Options -> Linker parameters. It compiled correctly, but it doesn't seem load image files correctly (BMPs or PNGs). Any clue why?


image = IMG_Load("image.bmp"); // or image.png
if(image == NULL){
fprintf(stderr, "Unable to load image: %s\n", IMG_GetError());
}


It always outputs:
Unable to load image: Unsupported image format


I've tried playing around with putting the libpng1.dll and zlib.dll everywhere and no success.

Share this post


Link to post
Share on other sites
Quote:
Original post by Rob Loach
It always outputs:
Unable to load image: Unsupported image format


have you tried solutions from this thread ?

i use the img_load function to load textures this way:

SDL_Surface *img;
img = IMG_Load(filename);
if(!img) cout<<IMG_GetError()<<endl;
SDL_LockSurface(img);
//..Opengl stuff here..
SDL_UnlockSurface(img);
SDL_FreeSurface(img);





and i have not had problems with 24 and 32BPP images (PNG,TGA,BMP)

//edit:also, assure that your application use sdl_image.dll file from my package.

[Edited by - happybara on November 30, 2004 3:20:00 PM]

Share this post


Link to post
Share on other sites

This topic is 4762 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this