Jump to content

  • Log In with Google      Sign In   
  • Create Account

Code::Blocks & SDL


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Acharis   Crossbones+   -  Reputation: 3988

Like
0Likes
Like

Posted 16 May 2012 - 03:41 AM

I want to make Code::Blocks work with SDL.

I downloaded Code::Blocks 10.05 (the package with MinGW/CGG) then followed these instructions http://wiki.codeblocks.org/index.php?title=Using_SDL_with_Code::Blocks#The_Process (downloaded SDL-devel-1.2.15-mingw32 instead 1.2.9 since that one was the newest).
Next, I created a project (selected "SDL project") and... it asks for "Please select SDL's location". I tried to put there the path to the whole SDL package (but then what was the point of copying these files manually to MinGW in previous steps?) but it still says "Can't locate SDL.h" (it's still the create project stage, no compilation or linking error).

Europe1300.eu - Historical Realistic Medieval Sim (RELEASED!)

PocketSpaceEmpire - turn based 4X with no micromanagement FB


Sponsor:

#2 mrjones   Members   -  Reputation: 612

Like
0Likes
Like

Posted 16 May 2012 - 04:21 AM

I think that the only thing you'd need to copy to either application directory or mingw/bin is SDL.dll. The following process worked for me after with SDL 1.2.15 development libraries. My CB might be a bit old (build 7289), but I doubt it would make a difference:

1. Set sdl variable BEFORE creating an SDL project. For me it crashes CB entirely or just did funny business in earlier versions.
To set sdl variable go to Settings->Global Variables, click New that's on the same line with Current Variable. Name it sdl. Set base to the directory where you unpacked the SDL package.
2. Create new SDL project with default values.
3. Build = if it works - great! If it doesn't then check under Project Options->Search Directories->Compiler and rename $(#sdl.include)\SDL to $(#sdl.include). Try again.

Edited by mrjones, 16 May 2012 - 04:27 AM.


#3 Inuyashakagome16   Members   -  Reputation: 835

Like
0Likes
Like

Posted 16 May 2012 - 06:10 AM

(downloaded SDL-devel-1.2.15-mingw32 instead 1.2.9 since that one was the newest).

Just to be sure it'll work right you should probably restart the process and use the version that they suggested in the guide and see if that changes anything. If it works with 1.2.9 just stick with that one for now till you find a way to make CB work with the newest version.

#4 Acharis   Crossbones+   -  Reputation: 3988

Like
0Likes
Like

Posted 16 May 2012 - 06:21 AM

Got it working (needed to copy sdl*.h files outside the SDL directory), thanks.

Now, I wonder. I managed to add SDL_ttf similar way (global options then SDL_ttf to linker and $(#sdl_ttf.lib/include) to search directories). But the curious thing, for SDL to work there needs to be SDL.dll in MinGW bin directory, SDLmain and sdl.dll listed on linker page. But for SDL_ttf there only needs to be SDL_ttf on linker page (the dll is somehow automaticly added from the libs directory without setting anything)... I tried to do the same thing with SDL (copied sdl.dll to the SDL libs directory) but it is not working.

Europe1300.eu - Historical Realistic Medieval Sim (RELEASED!)

PocketSpaceEmpire - turn based 4X with no micromanagement FB


#5 endless11111   Members   -  Reputation: 151

Like
0Likes
Like

Posted 16 May 2012 - 10:05 AM

You should go to Lazy foos site, he has tutorials on how to set up and start sdl on code blocks and set up extensions.
Here is how to set up sdl -- http://lazyfoo.net/SDL_tutorials/lesson01/windows/index.php
and extensions, this is for SDL_image but it works for all the other extensions. -- http://lazyfoo.net/SDL_tutorials/lesson03/windows/index.php




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS