How to install gfx and work with it

Hello,

I’ve downloaded SDL_gfx. Can someone please tell me where I am supposed to extract it so that it works ?
I’m using windows xp and codeblocks (with mingw).
Currently, my C:\Program Files\CodeBlocks contains codeblock.exe, a folder called mingw, a folder called SDL-devel-1.2.14-mingw32, and some other less significant files and folders.
I’m really starting so please give me a detailed answer, as what I found on the net wasn’t clear enough to me.
Thanks.

Can someone help me please ?

Did you look into that link I sent in the other thread?
http://code.bluedinosaurs.com/tutorials/installSDL.html

It discusses how to install libraries (not just SDL). Are there any
specific difficulties that you’re having?

Jonny DOn Fri, Mar 12, 2010 at 4:07 PM, Lilly wrote:

Can someone help me please ?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Yes, there are just too many files, not just a include folder and a lib one.
There are makefiles and things like this, it looks like I have to compile it myself so it’s rather difficult, hence I’m asking for your help.
Maybe you can download the .zip and see for yourself all the files that are there and then help me to install it properly.
Thanks in advance for any help you might provide.

You need to build the library yourself, I suppose. Make a new ‘Shared
Library’ project (you’re using Code::Blocks, right?). If it doesn’t say
’Shared Library’ on Windows, it might say something like ‘Dynamic Library’.
Add all of the .c files to it, double-check the output file name in the
project properties, then build it. If everything goes fine, you should have
some new files in the directory. There should be a .dll there and either a
.a or a .lib. Copy the .dll into any directory where you need it (like in
your game’s folder) and move the library files into your compiler’s 'lib’
folder. All of the .h files should be copied into your ‘include’ directory
(probably in include/SDL).

If you don’t want to have to do this for every library you find without
Windows binaries, then you should install msys. Then you can build software
the UNIX way.

Jonny DOn Sat, Mar 13, 2010 at 2:54 PM, Lilly wrote:

Yes, there are just too many files, not just a include folder and a lib
one.
There are makefiles and things like this, it looks like I have to compile
it myself so it’s rather difficult, hence I’m asking for your help.
Maybe you can download the .zip and see for yourself all the files that are
there and then help me to install it properly.
Thanks in advance for any help you might provide.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Ok, thanks for the answer.

I did what you asked, and it returned a .a, a .dll and a .def.
I didn’t use the .def because I don’t know what it is and you didn’t tell me what to do with it.
I put the .a in C:\Program Files\CodeBlocks\SDL-devel-1.2.14-mingw32\SDL-1.2.14\lib, a folder that also includes libSDLmain.a, SDL_ttf.lib, libSDL.la, libSDL.dll.a and now libSDL_gfx.dll.a.
I put the 6 .h in C:\Program Files\CodeBlocks\SDL-devel-1.2.14-mingw32\SDL-1.2.14\include, which now contains :
begin_code.h close_code.h doxyfile SDL SDL.h SDL_active.h SDL_audio.h SDL_byteorder.h SDL_cdrom.h SDL_config.h SDL_copying.h SDL_cpuinfo.h SDL_endian.h SDL_error.h SDL_events.h SDL_framerate.h SDL_getenv.h SDL_gfxBlitFunc.h SDL_gfxPrimitives.h SDL_gfxPrimitives_font.h SDL_imageFilter.h SDL_joystick.h SDL_keyboard.h SDL_keysym.h SDL_loadso.h SDL_main.h SDL_mouse.h SDL_mutex.h SDL_name.h SDL_opengl.h SDL_platform.h SDL_quit.h SDL_rotozoom.h SDL_rwops.h SDL_stdinc.h SDL_syswm.h SDL_thread.h SDL_timer.h SDL_ttf.h SDL_types.h SDL_version.h SDL_video.h.
I copied the dll into my game’s folder.
I typed #include <SDL_rotozoom.h> in the beginning, and
SDL_Surface* wking_img2 = zoomSurface (wking_img, 2, 2, 1);
somewhere in the code.

It still doesn’t work :

In function SDL_main': undefined reference tozoomSurface’.

You need to specify the library in your project. Go to the menu item
Project->Build options, then choose the Linker settings tab. Click ‘Add’ to
add a new library. Type in SDL_gfx (or SDL_gfx.dll?). You’ve probably
already done this with SDLmain, SDL, SDL_ttf, etc.

Jonny DOn Sun, Mar 14, 2010 at 2:01 PM, Lilly wrote:

Ok, thanks for the answer.

I did what you asked, and it returned a .a, a .dll and a .def.
I didn’t use the .def because I don’t know what it is and you didn’t tell
me what to do with it.
I put the .a in C:\Program
Files\CodeBlocks\SDL-devel-1.2.14-mingw32\SDL-1.2.14\lib, a folder that also
includes libSDLmain.a, SDL_ttf.lib, libSDL.la, libSDL.dll.a and now
libSDL_gfx.dll.a.
I put the 6 .h in C:\Program
Files\CodeBlocks\SDL-devel-1.2.14-mingw32\SDL-1.2.14\include, which now
contains :
begin_code.h close_code.h doxyfile SDL SDL.h SDL_active.h SDL_audio.h
SDL_byteorder.h SDL_cdrom.h SDL_config.h SDL_copying.h SDL_cpuinfo.h
SDL_endian.h SDL_error.h SDL_events.h SDL_framerate.h SDL_getenv.h
SDL_gfxBlitFunc.h SDL_gfxPrimitives.h SDL_gfxPrimitives_font.h
SDL_imageFilter.h SDL_joystick.h SDL_keyboard.h SDL_keysym.h SDL_loadso.h
SDL_main.h SDL_mouse.h SDL_mutex.h SDL_name.h SDL_opengl.h SDL_platform.h
SDL_quit.h SDL_rotozoom.h SDL_rwops.h SDL_stdinc.h SDL_syswm.h SDL_thread.h
SDL_timer.h SDL_ttf.h SDL_types.h SDL_version.h SDL_video.h.
I copied the dll into my game’s folder.
I typed #include in the beginning, and
SDL_Surface* wking_img2 = zoomSurface (wking_img, 2, 2, 1);
somewhere in the code.

It still doesn’t work :

In function SDL_main': undefined reference tozoomSurface’.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Ok thanks it works now. No I hadn’t done it with any other file, the list was empty until now. Is that normal ?
Should I ask the other librairies to this list as well ?

Well, if it’s working then apparently you’re all set. You do have to
specify the libraries to link somehow (this link libraries list,
-lsomelibrary on the command line, or sdl-config). If you don’t see the
libraries listed for any of your build targets and there’s nothing sneaky
going on (like the IDE using a Makefile), then I don’t know what to tell
you. If it works, just keep going.

Jonny DOn Mon, Mar 15, 2010 at 1:06 AM, Lilly wrote:

Ok thanks it works now. No I hadn’t done it with any other file, the list
was empty until now. Is that normal ?
Should I ask the other librairies to this list as well ?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org