[SDL] Setting up Code::Blocks IDE for SDL 1.3

William Dyce wilbefast at gmail.com
Thu Jul 28 23:54:07 PDT 2011


Thanks for the help guys :) - found out I'd actually used the wrong library
version, one without the renderer :-S For the record here's how I got things
working on Code::Blocks 10.05, starting from an empty project as suggested.
This is after downloading the newest SDL 1.3 revision via Mercurial. In
terminal:*

hg clone http://hg.libsdl.org/SDL
cd SDL
configure
make
sudo make install*

This should be everything in /usr/local/include and /usr/local/lib. So then
in Code::Blocks:

*Project > Build Options > Linker Settings > add: /usr/local/libSDL-1.3.so**
**Project > Build Options **> Search Directories > add:
/usr/local/include/SDL*

Then it's just as simpler as including *"SDL.h"*, it should be found in the
search directories. Obviously this is just for a basic project without any
special libraries, but the same logic should apply for SDL_image and so on.

Thanks again for the help: my project now compiles and runs on both Android
and Linux, without any change to the code :D

William


On 28 July 2011 04:48, <jeaye at arrownext.com> wrote:

> William,
>
> I've Code::Blocks 10.05 setup and working with SDL 1.3 on Slackware 13.37.
> All I did was locally compile SDL 1.3 and specify the include and library
> directories in Code::Blocks (start with an empty project). What works best
> for me is to not only specify the directories, but to also specify the
> exact library files so that Code::Blocks doesn't go about picking the SDL
> 1.2 ones. In the Linker options for your project, you're able to select
> actual libraries that you'd like to link to, instead of just specifying the
> directory and the -l<lib>. As far as SDL_image, SDL_ttf (etc.) go, I've
> just been letting Code::Blocks find them (so just using the SDL 1.2
> versions), and it's been working very well for me. Just specify -lSDL_image
> or -lSDL_ttf (etc.) in the linker settings for your project.
>
> Cheers,
> Jeaye
>
> > On Wed, Jul 27, 2011 at 3:30 AM, William Dyce <wilbefast at gmail.com>
> wrote:
> >> Hey guys,
> >>
> >> Just thought I might throw this out before I go too far along with it:
> >> the
> >> open-source IDE "Code::Blocks" is configured to compile projects using
> >> SDL
> >> 1.2 if it's installed. This basically just creates a project that will
> >> compile and link sources using `sdl-config --libs`. I'm wondering if
> >> there's
> >> a simple way of using the 1.3 libraries instead of the 1.2 ones. I just
> >> compiled and installed SDL-1.3.0-4429, so the libraries are all in
> >> /usr/local/lib, but Code::Blocks has a habit of using either the wrong
> >> headers (won't compile) or the wrong libraries (crashes at runtime -
> >> can't
> >> load .so). That's the trouble with IDEs I guess.
> >>
> >> I'm using 1.3 in order to develop a game for Android and later Linux,
> >> Mac,
> >> Windows, etc from the ground-up using SDL. Needless it's quicker and
> >> easier
> >> to test game logic under Ubuntu, so I'm working towards making
> something
> >> that will compile for either platform using macros (__ANDROID__ is
> >> defined
> >> by the port).
> >> Who here is working with 1.3? How have you set up your development
> >> environment?
> >>
> >> William
> >>
> >> _______________________________________________
> >> SDL mailing list
> >> SDL at lists.libsdl.org
> >> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
> >>
> >>
> > _______________________________________________
> > SDL mailing list
> > SDL at lists.libsdl.org
> > http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20110729/799c7a1c/attachment-0008.htm>


More information about the SDL mailing list