Using SDL_Image with Dev-C++

I’ve been fooling around with the idea of a 2D engine recently, and since
I don’t want BMP-only support I want to use SDL_Image.
I have compiled SDL_Image as a static library under Dev-C++. When I try to
call functions within SDL_Image, Dev-C++‘s linker gives me the following
error messages:
[Linker error] undefined reference to SDL_RWFromFile' [Linker error] undefined reference toSDL_SetError’
[Linker error] undefined reference to `SDL_SetError’
I am linking SDL with my whole project, and it normally works like a
charm. I have the following options set in my project options, under the
linker tab:
-lmingw32
-lSDLmain
-lSDL
-lSDL_image
-mwindows
I know the problem is tied to SDL_Image functions because whenever I stop
using them, my program compiles successfully. My guess is that maybe I
didn’t compile the library correctly. What I did to compile it was just
start a new Static Library project, added all the .c files that were in
the SDL_Image package, set my linker options to the same as above except
for the -lSDL_Image line and compiled away. It did give me a .a file,
called SDL_Image, which I renamed libSDL_Image.a so that it would be
easily useable within the mingw32 environment. My library file is 11k, if
it makes any difference.
As I said, I think it has something to do with my initial compiling of the
library…Just not sure what it might be.
Thanks!----------------------------------------------------------------------

MSN 8 helps ELIMINATE E-MAIL VIRUSES. Get 2 months FREE*.

Sdl_image comes with precompiled libs for zlib, libpng1 and libjpeg.
These are probably not compiled in the same code-generation - mode you
use.
You MUST compile all your code using the same codegeneration.
I personally use “multithreaded”, to avoid the need to include the
runtime dlls of visual studio. The best thing you can do is to download
libpng, zlib and libjpeg and recompile them in the mode you want.

I had a week of troubles because of the static libvorbis delivered with
sdl_mixer - this lib was compiled in single threaded modus (im not sure)
and i got endless conflicting libs error messages.

I’ve stopped 16.484 spam messages. You can too!
Get your free, safe spam protection at
http://www.cloudmark.com/spamnetsig/

-----Urspr?ngliche Nachricht-----Von: sdl-admin at libsdl.org [mailto:sdl-admin at libsdl.org] Im Auftrag von
Jean-Charles Frenette
Gesendet: Mittwoch, 7. Mai 2003 18:59
An: sdl at libsdl.org
Betreff: [SDL] Using SDL_Image with Dev-C++

I’ve been fooling around with the idea of a 2D engine recently, and
since I don’t want BMP-only support I want to use SDL_Image.

I have compiled SDL_Image as a static library under Dev-C++. When I try
to call functions within SDL_Image, Dev-C++'s linker gives me the
following error messages:

[Linker error] undefined reference to SDL_RWFromFile' [Linker error] undefined reference toSDL_SetError’
[Linker error] undefined reference to `SDL_SetError’

I am linking SDL with my whole project, and it normally works like a
charm. I have the following options set in my project options, under the
linker tab:

-lmingw32
-lSDLmain
-lSDL
-lSDL_image
-mwindows

I know the problem is tied to SDL_Image functions because whenever I
stop using them, my program compiles successfully. My guess is that
maybe I didn’t compile the library correctly. What I did to compile it
was just start a new Static Library project, added all the .c files that
were in the SDL_Image package, set my linker options to the same as
above except for the -lSDL_Image line and compiled away. It did give me
a .a file, called SDL_Image, which I renamed libSDL_Image.a so that it
would be easily useable within the mingw32 environment. My library file
is 11k, if it makes any difference.

As I said, I think it has something to do with my initial compiling of
the library…Just not sure what it might be.

Thanks!


MSN 8 helps HYPERLINK "http://g.msn.com/8HMIENCA/2752??PS="ELIMINATE
E-MAIL VIRUSES. Get 2 months FREE*.
_______________________________________________ SDL mailing list
SDL at libsdl.org http://www.libsdl.org/mailman/listinfo/sdl

Sorry, i did not see that you tried to use dev-c++ -
My comment is about visualstudio c++

I’ve stopped 16.484 spam messages. You can too!
Get your free, safe spam protection at
http://www.cloudmark.com/spamnetsig/

-----Urspr?ngliche Nachricht-----Von: sdl-admin at libsdl.org [mailto:sdl-admin at libsdl.org] Im Auftrag von
Andre Krause
Gesendet: Donnerstag, 8. Mai 2003 22:35
An: sdl at libsdl.org
Betreff: AW: [SDL] Using SDL_Image with Dev-C++

Sdl_image comes with precompiled libs for zlib, libpng1 and libjpeg.
These are probably not compiled in the same code-generation - mode you
use. You MUST compile all your code using the same codegeneration.
I personally use “multithreaded”, to avoid the need to include the
runtime dlls of visual studio. The best thing you can do is to download
libpng, zlib and libjpeg and recompile them in the mode you want.

I had a week of troubles because of the static libvorbis delivered with
sdl_mixer - this lib was compiled in single threaded modus (im not sure)
and i got endless conflicting libs error messages.

I’ve stopped 16.484 spam messages. You can too!
Get your free, safe spam protection at
http://www.cloudmark.com/spamnetsig/

-----Urspr?ngliche Nachricht-----
Von: sdl-admin at libsdl.org [mailto:sdl-admin at libsdl.org] Im Auftrag von
Jean-Charles Frenette
Gesendet: Mittwoch, 7. Mai 2003 18:59
An: sdl at libsdl.org
Betreff: [SDL] Using SDL_Image with Dev-C++

I’ve been fooling around with the idea of a 2D engine recently, and
since I don’t want BMP-only support I want to use SDL_Image.

I have compiled SDL_Image as a static library under Dev-C++. When I try
to call functions within SDL_Image, Dev-C++'s linker gives me the
following error messages:

[Linker error] undefined reference to SDL_RWFromFile' [Linker error] undefined reference toSDL_SetError’
[Linker error] undefined reference to `SDL_SetError’

I am linking SDL with my whole project, and it normally works like a
charm. I have the following options set in my project options, under the
linker tab:

-lmingw32
-lSDLmain
-lSDL
-lSDL_image
-mwindows

I know the problem is tied to SDL_Image functions because whenever I
stop using them, my program compiles successfully. My guess is that
maybe I didn’t compile the library correctly. What I did to compile it
was just start a new Static Library project, added all the .c files that
were in the SDL_Image package, set my linker options to the same as
above except for the -lSDL_Image line and compiled away. It did give me
a .a file, called SDL_Image, which I renamed libSDL_Image.a so that it
would be easily useable within the mingw32 environment. My library file
is 11k, if it makes any difference.

As I said, I think it has something to do with my initial compiling of
the library…Just not sure what it might be.

Thanks!


MSN 8 helps HYPERLINK "http://g.msn.com/8HMIENCA/2752??PS="ELIMINATE
E-MAIL VIRUSES. Get 2 months FREE*.
_______________________________________________ SDL mailing list
SDL at libsdl.org http://www.libsdl.org/mailman/listinfo/sdl


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

Hello!

I would like to start work under Dev-C++ on the Win32 platform with

SDL. I`m new to DevC++, but have experience with VSC++.
Will it be easier to port an application to Linux platform using DevC++
instead of VSC++?
What do I need to do to load SDL project in DevC++? I cannot find a
DevC++ project file in SDL package…
Thank you!

Kind regards,
Alexander Gayevoy

Hello there,

I would like to start work under Dev-C++ on the Win32 platform
with SDL. I`m new to DevC++, but have experience with VSC++. 

Will it be easier to port an application to Linux platform using
DevC++ instead of VSC++?
What do I need to do to load SDL project in DevC++? I cannot find a
DevC++ project file in SDL package…

I have worked with Dev-C++ for a while to try compiling my game (coded
mainly on Linux) on windows with it. I downloaded the newest beta
version of Dev-C++ (0.4.9.8) Installed it and run the packet manager
to selected there the SDL Package. After Dev-C++ have installed these,
i could compile my game without any problems. I just copyed all *.h
and *.c files into the new Project and created manualy a file which is
usualy generated by automake/autoconf.

Some difficults you will get if you which to port your game to Linux
(or other systems). Difficults i have got:

  • Reading Directorys (FindFirstFile ~ opendir and so on…)
  • Network Part (well i never tested the SDL_net Library)
  • a function the let the game wait for a few milliseconds…
    (SDL_Delay worked to slow) and my way over select works
    now for both but on windows i never get with it the CPU
    usage down.

oky that’s all right now and i hope i could help…
bye bye,
Steffen–

Steffen Pohle (@Steffen_Pohle)| _ x
http://stpohle.bei.t-online.de | /#/ BomberClone - The Clone of
JabberID: stpohle at amessage.de ||###| DynaBlaster and Bomberman
ICQ: 370965 Yahoo: stpohle | #/ http://www.bomberclone.de
MSN: stpohle at hotmail.com |

Hello there!

I must say yes so far. I have an app/game under developement under
linux, but use devc++ to port it to win32 (for friends not so techy).
And it has worked just ab-fab great for me. I use SDL+SDL_image+SDL_ttf
in my proggy. The only thing I had to think of is making functions et
all in a more ordered fashion. The MingW32 is more sensitive to where
you put your vars (INT, CHAR …) and SDL_Surface, SDL_Rect:s. Those
cant be put just any where in your code. Finally, I am a junior
programmer, so probably this is only happening to me. :slight_smile: But your milage
may differ ™.

Best reg. /Patrich

fre 2003-05-09 klockan 17.29 skrev Alexander Gayevoy:> Hello!

I would like to start work under Dev-C++ on the Win32 platform with

SDL. I`m new to DevC++, but have experience with VSC++.
Will it be easier to port an application to Linux platform using DevC++
instead of VSC++?
What do I need to do to load SDL project in DevC++? I cannot find a
DevC++ project file in SDL package…
Thank you!

Kind regards,
Alexander Gayevoy


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

Patrich Bj?rklund <@Patrich_Bjorklund>
Home Factory

BTW check out google: ‘devc++ download’

You will in the installer/updater be able to define what packages to get
in your DevC++ env. (OpenGl,SDL, SDL_ttf, etc). NOT the latest versions
though. (Warning).

I, myself is doing DevC++ (conversion) with beta version and under Win2k
Pro.

/Patrich

fre 2003-05-09 klockan 17.29 skrev Alexander Gayevoy:> Hello!

I would like to start work under Dev-C++ on the Win32 platform with

SDL. I`m new to DevC++, but have experience with VSC++.
Will it be easier to port an application to Linux platform using DevC++
instead of VSC++?
What do I need to do to load SDL project in DevC++? I cannot find a
DevC++ project file in SDL package…
Thank you!

Kind regards,
Alexander Gayevoy


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

Patrich Bj?rklund <@Patrich_Bjorklund>
Home Factory