Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Al MacInnis

C++, SDL & SDL_image Link problem [RESOLVED]

This topic is 5122 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 am working on a SDL program, and there are no problems. Yesterday, i included the SDL_image library in order to load PNG, JPG... images in my program. I put the #include <SDL_image.h> as required. Compilation , no problems. Link : Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland Error: Unresolved external '_IMG_Load' referenced from C:\PROGRAMMATION\C++\SDL\SPRITES.OBJ I am using the IMG_load (char *file) function... Where am i wrong ? Did i forgot a file in the linker command line ? Thank you. "Everyday above ground is a good day" (Mel in Scarface) Edited by - Al MacInnis on February 21, 2002 1:22:44 PM [edited by - Al MacInnis on August 16, 2002 12:51:21 PM]

Share this post


Link to post
Share on other sites
Advertisement

I put zlib.dll libpng1.dll and SDL_image.dll in the Lib directory.
With implib, i created the .lib associated, and i put them in the command line of the linker, i get the same error

Share this post


Link to post
Share on other sites
Are we talking about SDL (Simple DirectMedia Layer)? If so, I''ve never seen IMG_load. Do you mean SDL_LoadBMP(const char *file)?? Anyway, you only have to include "SDL.h" to use it and that''s it.

Share this post


Link to post
Share on other sites
He is using SDL, but with the SDL_image library.

Are you sure you downloaded the right source? I know if you try to compile vc++ libraries with dev-c++ it won''t work. You have to download the mingw32 developer source. To get SDL to compile I have to link with

-lmingw32 -lSDLmain -lSDL

(and then don''t forget to link SDL_image)

Then I just check do not make a console. (I think the flag is -mwindows but i''m not sure)

Share this post


Link to post
Share on other sites
I am using Borland''s free compilers, and i downloaded (at least i think) the rioght components (for Win32 non VC++, there are no multiple choices )

here is the command line that makes the error :


ilink32 -aa -Tpe -L"c:\Programmation\Compil~1\Lib" %P%N.obj import32.lib SDL_image.lib sdl.lib zlib.lib libpng1.lib c0w32.obj cw32.lib

I added SDL_image.lib zlib.lib, libpng1.lib in the command line, since my programs without SDL_image (which run very fine).

Where is the problem :''( ?

"Everyday above ground is a good day" (Mel in Scarface)

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!