Getting Codeblocks To Work...


Yaustar, I assume you got my last PM? Go for gusto, I can wait for that.

Dimacus: I downloaded what you posted online, and I was able to compile the ARM-linux version just fine using "devkitGP2X Compiler" settings. Perhaps this is significant?
 
Right, this is raw basics until I really get a decent amount of time to fully develop the idea of a decent portable Code::Blocks development environment.

Here is the link for Code::Blocks nightly build with LOCAL compiler/option settings for DevKitGP2X which I use: http://www.sendspace.com/file/a5yr17 (ignore the SDL_test.zip file since I uploaded the wrong one :$)

Here is the link to the modified SDL_test source and project files to check with: http://www.sendspace.com/file/g1kc83

To use this, you must delete your current Code::Blocks directory and also all your user settings. This is the only way that we can get C::B to check for local settings. To delete your current user settings, go to %APPDATA% (or C:\Documents and Settings\User_name\Application Data) and delete the codeblocks folder.

The Code::Blocks current compiler settings is setup for DevKitGP2X which must be installed on the C drive root. (ie C:\DevkitGP2X)

You can either use DJWillis's which is pretty up to date:
http://archive.gp2x.de/cgi-bin/cfiles.cgi?0,0,0,0,14,1918

Or use the old DevKitGP2X:
http://archive.gp2x.de/cgi-bin/cfiles.cgi?0,0,0,0,14,1362
And install the new SDL libs over the top:
http://archive.gp2x.de/cgi-bin/cfiles.cgi?0,0,0,0,19,1875

Let me know if I have screwed something up...
 
Scrap the last post, I made this even more simpler:

To use this, you must delete your current Code::Blocks directory and also all your user settings. This is the only way that we can get C::B to check for local settings. To delete your current user settings, go to %APPDATA% (or C:\Documents and Settings\User_name\Application Data) and delete the codeblocks folder.

Delete your current DevKitGP2X folder.

(IE this is a clean install)

Unzip this file to the root of your C drive: http://www.sendspace.com/file/nkz40f

This includes the folders for CodeBlocks (SVN Nightly 30 May 07), DevKitGP2X (DJWillis Oct 06 Toolchain and Guyfawkes Oct 06 SDL libraries) and the SDL test project.

The CodeBlocks and SDL_test files can go anywhere on the computer but DevKitGP2X must remain at the root of the C drive.

All settings, user templates and compiler settings are now stored locally in your CodeBlock folder unless it detects user settings in %APPDATA%.
 
Well, basicly it means that you have SDL and that it's working just fine, when no other libraries are involved.
you could add code snippets from the SDL_Test project (and add the corresponding librarie) to see when the error occur.

My guess is that the order in which the compiler/linker is doing stuff is somewhat wrong, a bit like adding SDL_Mixer.h before SDL.h or linking in SDL.a before SDLmain.a (this several strange errors).

Edit:
But now yaustar seems to have comeup with a peritty nice solution, so give that a go before you begin to dig into the depths of dependencies and sutch :)
 
Ah excellent Yaustar, it will be nice for those that want to just dive in and code! :)

I know I'd appreciate templates for dual compiling... currently I just have a codeblocks project file and a VStudio2005 project file to compile for windows... it's not ideal but it works!
 
I would muchly appreciate that too yaustar. :)

I realised that Gufawkes and SDL have moved on since I last fiddled with it[7 months ago :eek: ]. When I tried updating everything and rebuilding I also get problems. It is unable to link to SDL_SYS_JoystickGp2xSys.

Am I just missing a lib ? If so which one ?
 
Mr.Jabberwocky said:
I would muchly appreciate that too yaustar. :)

I realised that Gufawkes and SDL have moved on since I last fiddled with it[7 months ago :eek: ]. When I tried updating everything and rebuilding I also get problems. It is unable to link to SDL_SYS_JoystickGp2xSys.

Am I just missing a lib ? If so which one ?
If you grab the full toolchain from my upload and replace yours completely, that should work.
 
Last edited by a moderator:
THE DAYS OF RECKONING:
First there was the razing of the Linklands - the Blockaded Kingdom heard reports from panting messengers that the Linklands... they burned!

Foolishly, the staunch King sent messengers to check upon those in the Linklands, but none returned. Then came word from the North...

"OUR APPLICATION SETTINGS ARE GONE!"

The King summoned his personal guard, his fat queen and their obese children, they tried to run as like scurrying rats, but it was too late, the reckoning had come for them.

No witnesses were left, no stories remembered... just an etching on the plaster of a Code wall "I have seen the end - no one survives - not even the NIBBLES!"

....
 
Last edited by a moderator:
The :ph34r: stood and observed their work, and awaited their Shinto Gods from on high...

CODE
:: === SDL_dimacus_test, Release ===
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_dimacus\SDL_dimacus_test\main.cpp:8: error: SDL.h: No such file or directory
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_dimacus\SDL_dimacus_test\main.cpp:12: error: expected constructor, destructor, or type conversion before '*' token
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_dimacus\SDL_dimacus_test\main.cpp:13: error: expected constructor, destructor, or type conversion before '*' token
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_dimacus\SDL_dimacus_test\main.cpp:17: error: 'SDL_INIT_VIDEO' was not declared in this scope
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_dimacus\SDL_dimacus_test\main.cpp:17: error: 'SDL_INIT_AUDIO' was not declared in this scope
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_dimacus\SDL_dimacus_test\main.cpp:17: error: 'SDL_INIT_JOYSTICK' was not declared in this scope
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_dimacus\SDL_dimacus_test\main.cpp:17: error: 'SDL_Init' was not declared in this scope
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_dimacus\SDL_dimacus_test\main.cpp:22: error: 'SDL_DISABLE' was not declared in this scope
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_dimacus\SDL_dimacus_test\main.cpp:22: error: 'SDL_ShowCursor' was not declared in this scope
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_dimacus\SDL_dimacus_test\main.cpp:23: error: 'screen' was not declared in this scope
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_dimacus\SDL_dimacus_test\main.cpp:23: error: 'SDL_SWSURFACE' was not declared in this scope
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_dimacus\SDL_dimacus_test\main.cpp:23: error: 'SDL_SetVideoMode' was not declared in this scope
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_dimacus\SDL_dimacus_test\main.cpp:29: error: 'joystick' was not declared in this scope
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_dimacus\SDL_dimacus_test\main.cpp:29: error: 'SDL_JoystickOpen' was not declared in this scope
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_dimacus\SDL_dimacus_test\main.cpp:36: error: 'SDL_Rect' was not declared in this scope
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_dimacus\SDL_dimacus_test\main.cpp:36: error: expected `;' before 'tRect'
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_dimacus\SDL_dimacus_test\main.cpp:37: error: 'tRect' was not declared in this scope
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_dimacus\SDL_dimacus_test\main.cpp:37: error: 'SDL_FillRect' was not declared in this scope
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_dimacus\SDL_dimacus_test\main.cpp:38: error: 'SDL_Flip' was not declared in this scope
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_dimacus\SDL_dimacus_test\main.cpp:39: error: 'SDL_Delay' was not declared in this scope
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_dimacus\SDL_dimacus_test\main.cpp:40: error: 'SDL_Quit' was not declared in this scope
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_dimacus\SDL_dimacus_test\main.cpp:15: warning: unused parameter 'arc'
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_dimacus\SDL_dimacus_test\main.cpp:15: warning: unused parameter 'argv'
:: === Build finished: 21 errors, 2 warnings ===



...I did notice that "devkitGP2X" was unzipped but the GP2X Compiler settings were looking for "DevkitGP2X" so I changed the casing, but that didn't change anything.

Also, PokeParadox's project, which used to compile (chuckles) now does this:
CODE
C:\Documents and Settings\Owner\My Documents\PROJECTS\PokeParadox\BaseState.h:4: error: SDL.h: No such file or directory
C:\Documents and Settings\Owner\My Documents\PROJECTS\PokeParadox\InputHandler.h:17: error: expected ',' or '...' before '&' token
C:\Documents and Settings\Owner\My Documents\PROJECTS\PokeParadox\InputHandler.h:17: error: ISO C++ forbids declaration of 'Uint8' with no type
C:\Documents and Settings\Owner\My Documents\PROJECTS\PokeParadox\InputHandler.h:18: error: expected ',' or '...' before '&' token
C:\Documents and Settings\Owner\My Documents\PROJECTS\PokeParadox\InputHandler.h:18: error: ISO C++ forbids declaration of 'Uint8' with no type
C:\Documents and Settings\Owner\My Documents\PROJECTS\PokeParadox\InputHandler.h:105: error: ISO C++ forbids declaration of 'SDL_Joystick' with no type
C:\Documents and Settings\Owner\My Documents\PROJECTS\PokeParadox\InputHandler.h:105: error: expected ';' before '*' token
C:\Documents and Settings\Owner\My Documents\PROJECTS\PokeParadox\InputHandler.h:106: error: 'SDL_Event' does not name a type
C:\Documents and Settings\Owner\My Documents\PROJECTS\PokeParadox\BaseState.h:15: error: 'SDL_Surface' has not been declared
C:\Documents and Settings\Owner\My Documents\PROJECTS\PokeParadox\BaseState.cpp:13: error: variable or field 'render' declared void
C:\Documents and Settings\Owner\My Documents\PROJECTS\PokeParadox\BaseState.cpp:13: error: 'int BaseState::render' is not a static member of 'class BaseState'
C:\Documents and Settings\Owner\My Documents\PROJECTS\PokeParadox\BaseState.cpp:13: error: 'SDL_Surface' was not declared in this scope
C:\Documents and Settings\Owner\My Documents\PROJECTS\PokeParadox\BaseState.cpp:13: error: 'screen' was not declared in this scope
C:\Documents and Settings\Owner\My Documents\PROJECTS\PokeParadox\BaseState.cpp:14: error: expected ',' or ';' before '{' token
:: === Build finished: 14 errors, 0 warnings ===


I'm uhhh... I'm unsure. Thank you Yaustar for working so hard on this with me, Alex and PokeParadox too. I'm beginning to think I should revisit this when I get my GP2X or try something else. Unless y'all got somethin' else.

Edit: And Jabberwocky and Dimacus! Sorry guys.
 
I have just gotten around to unzipping yausters set up and have replaced devkit and codeblocks. The supplied sdltest project built just fine. Have you tried building it ?

Do the SDL includes in your projects follow the format #include <SDL/SDL.h> ?
 
Hnmm no they don't... changing that yields this...
CODE
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_dimacus\SDL_dimacus_test\main.cpp:15: warning: unused parameter 'arc'
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_dimacus\SDL_dimacus_test\main.cpp:15: warning: unused parameter 'argv'
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_dimacus\SDL_dimacus_test\main.cpp:17: undefined reference to `SDL_Init'
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_dimacus\SDL_dimacus_test\main.cpp:22: undefined reference to `SDL_ShowCursor'
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_dimacus\SDL_dimacus_test\main.cpp:23: undefined reference to `SDL_SetVideoMode'
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_dimacus\SDL_dimacus_test\main.cpp:29: undefined reference to `SDL_JoystickOpen'
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_dimacus\SDL_dimacus_test\main.cpp:37: undefined reference to `SDL_FillRect'
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_dimacus\SDL_dimacus_test\main.cpp:38: undefined reference to `SDL_Flip'
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_dimacus\SDL_dimacus_test\main.cpp:39: undefined reference to `SDL_Delay'
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_dimacus\SDL_dimacus_test\main.cpp:40: undefined reference to `SDL_Quit'
:: === Build finished: 8 errors, 2 warnings ===



Adding the same "SDL\" to the SDL.h, of course, doesn't help. Grr.
 
Acually if that was for my code, it did.
It seems as if we are back a couple of pages, that my friend is an indication of libraries that are not being linked too.

Check under the projects or the global settings, if you acually are linking to SDL and SDLmain.
 
Open yauster's SDL_Test project and copy the linker parameters from that.

Edit: I tried Dimacus' test using the arm-linux folder. The project does not seem to be complete. I made a copy of yauster's SDL project, deleted the files in it, and added Dimacus' main.cpp. That now builds.

If you are still having trouble see if yauster's SDL project works for you. If so, use that as a base for all your projects by deleting the files, saving the project and adding your own files to the empty project.
 
Clumsy me :/
I forgot to save the CB projectfile before i rared it.
Here is how the TestProject.cbp should look.(I also updated the file in the arcives).
CODE
<?xml version="1.0"?>
<!DOCTYPE CodeBlocks_project_file>
<CodeBlocks_project_file>
<FileVersion major="1" minor="1"/>
<Project>
<Option title="TestProject"/>
<Option makefile="Makefile"/>
<Option makefile_is_custom="0"/>
<Option compiler="6"/>
<Build>
<Target title="default">
<Option output=".\TestProject.gpe"/>
<Option working_dir="."/>
<Option object_output=".objs"/>
<Option deps_output=".deps"/>
<Option type="0"/>
<Option compiler="0"/>
<Option projectResourceIncludeDirsRelation="0"/>
</Target>
</Build>
<Linker>
<Add option="-static"/>
<Add library="SDLmain"/>
<Add library="SDL"/>
<Add library="pthread"/>
</Linker>
<Unit filename="main.cpp">
<Option compilerVar="CPP"/>
<Option target="default"/>
</Unit>
</Project>
</CodeBlocks_project_file>
 
Thanks for the update Dimacus.

I have just tried building an old project with this set up. I appear to have been using SDL_JoystickUpdate(); and SDL_JoystickGetButton(joystick, input) to read input. Although it builds, these functions no longer seem to work.

Anyone know what is going on ? Thanks.
 
Mr.Jabberwocky said:
Thanks for the update Dimacus.

I have just tried building an old project with this set up. I appear to have been using SDL_JoystickUpdate(); and SDL_JoystickGetButton(joystick, input) to read input. Although it builds, these functions no longer seem to work.

Anyone know what is going on ? Thanks.
I use the same method for reading input, I find it the cleanest and simplest. Was it intentionally dropped, or is it just a temporary problem?

The only thing I do for it to work is OR SDL_INIT_JOYSTICK to SDL_Init(), and call SDL_Joystick* joystick = SDL_JoystickOpen(0);
 
Last edited by a moderator:
Back
Top