Special flags to compile with SDL_image?

Keep getting the following error under linux 2.4.2-2 (Redhat 7.1):

=[~/devel/armor ]=$ g++ shot_test1.cpp -o shot_test sdl-config --libs --cflags
/tmp/ccgzYyAz.o: In function SpriteBase::init(char *)': /tmp/ccgzYyAz.o(.text+0x1f6): undefined reference toIMG_Load’
collect2: ld returned 1 exit status

This is only on link. The compile is fine, or at least silent.

other info:
[root at chuang_tzu armor]# /sbin/ldconfig -v | grep SDL_i
/sbin/ldconfig: Path `/usr/lib’ given more than once
libSDL_image-1.2.so.0 -> libSDL_image-1.2.so.0.1.0

[root at chuang_tzu armor]# which sdl-config
/usr/local/bin/sdl-config

[root at chuang_tzu armor]# sdl-config --cflags --libs
-I/usr/local/include -I/usr/local/include/SDL -D_REENTRANT
-L/usr/local/lib -Wl,-rpath,/usr/local/lib -lSDL -lpthread

code:
#include <SDL/SDL.h>
#include “SDL_image.h”

– SNIP –

SDL_Surface *temp;
if ((temp = IMG_Load(filename)) == NULL)
{
return -1;
}

– SNIP –

That’s the only reference to IMG_Load in the entire file.
I also tried #include <SDL/SDL_image.h> No dice there, either.
The SDL_image header file IS in /usr/loca/include/SDL/.
Does SDL_image need some special args to pass to g++?

Thanks…

-HaB_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.

I don’t see you refering the library itself with -SDL_image.

Unfortunately sdl-config does NOT seem to take care of this (ok,
which make rather sense; there should be an sdl_image-config or
whatever). HTH

On Wed, Apr 03, 2002 at 01:44:04PM -0500, HaB JacKaL wrote :> Keep getting the following error under linux 2.4.2-2 (Redhat 7.1):

=[~/devel/armor ]=$ g++ shot_test1.cpp -o shot_test sdl-config --libs --cflags
/tmp/ccgzYyAz.o: In function SpriteBase::init(char *)': /tmp/ccgzYyAz.o(.text+0x1f6): undefined reference toIMG_Load’
collect2: ld returned 1 exit status

This is only on link. The compile is fine, or at least silent.

other info:
[root at chuang_tzu armor]# /sbin/ldconfig -v | grep SDL_i
/sbin/ldconfig: Path `/usr/lib’ given more than once
libSDL_image-1.2.so.0 -> libSDL_image-1.2.so.0.1.0

[root at chuang_tzu armor]# which sdl-config
/usr/local/bin/sdl-config

[root at chuang_tzu armor]# sdl-config --cflags --libs
-I/usr/local/include -I/usr/local/include/SDL -D_REENTRANT
-L/usr/local/lib -Wl,-rpath,/usr/local/lib -lSDL -lpthread

code:
#include <SDL/SDL.h>
#include “SDL_image.h”

– SNIP –

SDL_Surface *temp;
if ((temp = IMG_Load(filename)) == NULL)
{
return -1;
}

– SNIP –

That’s the only reference to IMG_Load in the entire file.
I also tried #include <SDL/SDL_image.h> No dice there, either.
The SDL_image header file IS in /usr/loca/include/SDL/.
Does SDL_image need some special args to pass to g++?

Thanks…

-HaB


Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Please always Cc to me when replying to me on the lists.
GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc
"Mind if I MFH ?" “What QA did you do on it?” “the usual?” “ah… none :)”

And, btw, if you use --cflags you don’t write

    #include <SDL/SDL.h>

because SDL/ is already in your include path. You rather
write #include "SDL.h" and #include "SDL_image.h"

On Thu, Apr 04, 2002 at 12:16:45AM +0200, Markus Fischer wrote :> I don’t see you refering the library itself with -SDL_image.

Unfortunately sdl-config does NOT seem to take care of this (ok,
which make rather sense; there should be an sdl_image-config or
whatever). HTH

On Wed, Apr 03, 2002 at 01:44:04PM -0500, HaB JacKaL wrote :

Keep getting the following error under linux 2.4.2-2 (Redhat 7.1):

=[~/devel/armor ]=$ g++ shot_test1.cpp -o shot_test sdl-config --libs --cflags
/tmp/ccgzYyAz.o: In function SpriteBase::init(char *)': /tmp/ccgzYyAz.o(.text+0x1f6): undefined reference toIMG_Load’
collect2: ld returned 1 exit status

This is only on link. The compile is fine, or at least silent.

other info:
[root at chuang_tzu armor]# /sbin/ldconfig -v | grep SDL_i
/sbin/ldconfig: Path `/usr/lib’ given more than once
libSDL_image-1.2.so.0 -> libSDL_image-1.2.so.0.1.0

[root at chuang_tzu armor]# which sdl-config
/usr/local/bin/sdl-config

[root at chuang_tzu armor]# sdl-config --cflags --libs
-I/usr/local/include -I/usr/local/include/SDL -D_REENTRANT
-L/usr/local/lib -Wl,-rpath,/usr/local/lib -lSDL -lpthread

code:
#include <SDL/SDL.h>
#include “SDL_image.h”

– SNIP –

SDL_Surface *temp;
if ((temp = IMG_Load(filename)) == NULL)
{
return -1;
}

– SNIP –

That’s the only reference to IMG_Load in the entire file.
I also tried #include <SDL/SDL_image.h> No dice there, either.
The SDL_image header file IS in /usr/loca/include/SDL/.
Does SDL_image need some special args to pass to g++?

Thanks…

-HaB


Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Please always Cc to me when replying to me on the lists.
GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc
"Mind if I MFH ?" “What QA did you do on it?” “the usual?” “ah… none :)”


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Please always Cc to me when replying to me on the lists.
GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc
"Mind if I MFH ?" “What QA did you do on it?” “the usual?” “ah… none :)”