Getting Codeblocks To Work...


Ha Ha Ha Ha


PokeParadox can't get SDL_test won't compile for him either!

I was beggining to think there was something wrong with the test. Can anyone else here with CodeBlocks download the SDL test and try it out?
 
Last edited by a moderator:
Welcome back, David. I had a go setting up Codeblocks a while back and used Guyfawkes SDL_Test to test my setup. I have just searched it out and it still works. I am no expert but I will describe the stuff in the windowy things if you like.
I did record my pitiful attempts at writing a game somewhere on here. It may be helpful but I think it is mostly just me moaning about what a thankless, frustrating waste of good drinking time the whole experience was. Its here.
 
Last edited by a moderator:
I got it to compile (not surprising since I wrote the original tutorial). Did any of you guys read step 15?
62xqybo.png


Note: I had to change the following code for it to work:
From
CODE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fstream>
#include "SDL.h"
#include "SDL_ttf.h"
#include "SDL_image.h"
#include "SDL_rotozoom.h"
#include "SDL_mixer.h"
#include "sdltest.h"

to
CODE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fstream>
#include <SDL.h>
#include <SDL_ttf.h>
#include <SDL_image.h>
#include <SDL_rotozoom.h>
#include <SDL_mixer.h>
#include "sdltest.h"

In the source file. The < and > means to search for that file in the compiler settings include directory rather then in project space.
 
I just compiled SDL_test, and everything went fine. Seriously David, don't be so stubborn and install the stable release of Codeblocks I linked you to at the end of last page... Everything is very simple then, so why torture yourself?
 
Actually, the nightly build is more stable then 1.0rc2 to be honest even by the author's own admission and much more feature rich. There is very little difference between the setup of the two for DevKitGP2X.
 
yauster, you seem to have it setup the same way as I do.

The linker tab for the global compiler window has nothing set in it. So it is only set for the current project.

I have -static -lSDL_gfx -lSDL_ttf -lfreetype -lSDL_image -ljpeg -lpng12 -lz -lSDL_mixer -lvorbisidec -lmikmod -lsmpeg -lSDL -lgcc -lm -lc -lexpat -lpthread in the linker tab of project build/linker tab/other settings list. The link libraries list is empty as in yauster's screen capture.

To get that dialogue box select Project->Build options from the menu and select the linker tab.

Putting it in the global compiler settings might be more sensible since the compiler/linker supposedly ignore unused libraries. This way it should be all set for every new project.

As for making it generate a .gpe extension : in Project->Properties there is a targets tab with a field for the Output filename. Setting the .gpe here has always reliably generated that extension for me.
 
David Beoulve said:
What I complained about in IRC is the difficulty in getting the specific bits of knowledge together that any other progarmming environment is easy and there are loads of folks with knowhow and very few tutorials - and no "this is a parallax engine" kinda stuff going on. Basically, to become a GP2X dev you hang out in IRC, which is fine for some, but I was trying to convey "How many people are going to work as hard to get here to realize this is what you need to do?"

Programming is hard full stop. The curve gets steeper as soon as you delve into console development and cross compilers. There specific GP2X tutorials because quite frankly, there doesn't need to be one thanks to the SDL library and support. There is a ton of non-platform specific tutorials, material etc on the Internet that GP2X specific tutorials would be pointless.

The tutorials on installing a toolchain and IDE (plus a few details on the joystick etc) as given on the Wiki is all that is needed. The rest is up to the individual learning to program.
 
Last edited by a moderator:
Thank you guys...

I emptied the left Link List Pane and put in the line Jabberwocky said.

I also changed the INCLUDE statements as yaustar indicated.

Okay here's the latest:
CODE
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_test\sdltest.cpp:536: error: 'BACK_LIGHT_OFF' was not declared in this scope
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_test\sdltest.cpp:536: error: 'SDL_SYS_JoystickGp2xSys' was not declared in this scope
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_test\sdltest.cpp:536: error: 'BACK_LIGHT_ON' was not declared in this scope
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_test\sdltest.cpp:537: error: 'BATT_LED_ON' was not declared in this scope
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_test\sdltest.cpp:537: error: 'SDL_SYS_JoystickGp2xSys' was not declared in this scope
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_test\sdltest.cpp:537: error: 'BATT_LED_OFF' was not declared in this scope
:: === Build finished: 6 errors, 0 warnings ===



Clearly, much farther along.

Alex: Because I'm friends with PokeParadox and I'd prefer to use the same development environment as him if at all possible. Keeps down on the issues when sharing code. I could be wrong on this but I remember in the early 90's moving from Borland C to ... whatever the free plain text C was at the time, and then early MS C, was odd. The compilers literally operated differently on things like how they handled and ended files. Again, perhaps I'm way out dated, but these compilers I'm setting up now remind me of those days so I figured "Get CodeBlocks working." Correct me if I'm wrong.

Edit:
yaustar said:
The tutorials on installing a toolchain and IDE (plus a few details on the joystick etc) as given on the Wiki is all that is needed. The rest is up to the individual learning to program.
Oh I agree completely that programming should be the hard part. Half the class failed "Beginning C". After "Beginning C" in college, half the class failed "Intermediate C". By now I thought "We're the crem-de-la-crem! We're programmers." Then in "Advanced C++", half the class failed.

However, I don't think I should still be kicking around with getting a development environment up, nor that every new GP2X programmer need reinvent the wheel every time he's trying to figure out "How do I display a graphic / play a sound / access the frame buffer?" Some of those things are specific to a GP2X.

But I hear what you are saying. None programmers need not apply.

PS - I got straight A's in those courses he he he.
 
Last edited by a moderator:
Ah ho ha! Doing so...

Overwrote all files (dates were different)

Closed CodeBlocks, reopened, opened existing project, hit compile...

CODE
:: === SDL_test, Release ===
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_test\sdltest.cpp:536: error: 'BACK_LIGHT_OFF' was not declared in this scope
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_test\sdltest.cpp:536: error: 'SDL_SYS_JoystickGp2xSys' was not declared in this scope
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_test\sdltest.cpp:536: error: 'BACK_LIGHT_ON' was not declared in this scope
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_test\sdltest.cpp:537: error: 'BATT_LED_ON' was not declared in this scope
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_test\sdltest.cpp:537: error: 'SDL_SYS_JoystickGp2xSys' was not declared in this scope
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_test\sdltest.cpp:537: error: 'BATT_LED_OFF' was not declared in this scope
:: === Build finished: 6 errors, 0 warnings ===


Off topic but I just read all of the Escapism article on burnout from your blog and found it to be true.
 
Try a rebuild. Also look in \DevKitGP2x\include\SDL\SDL_Joystick.h for those definitions to see if they exist. If they do, then there is something wrong with your compiler/project setup.
 
I just tested SDL_Test aswell, and after a little fiddeling with the libraries i got it to work on my pc, i have yet to test it on my 2x, but i see no problems.

Anyhow, if you still are having problems david, i have created a very simple project that only uses sdl and have all the compiler settings needed in the project file.
I have uploaded it to rapidshare: ttp://rapidshare.com/files/34823250/SDL-test.rar.html
 
C:\devkitGP2X\include\SDL\SDL_joystick.h is there

Rebuild - why didn't I think of that? Doesn't work - and I added "SDL_joystick.h" to the includes in <>'s.

I assume what the compiler is complaining about is static variables...

They are defined within the H file in question...
CODE
#define IOCTL_GP2X_CONTROL_LIB _IOR('v', 0x00 ,unsigned long)
#define BACK_LIGHT_OFF 0
#define BACK_LIGHT_ON 1
#define BATT_LED_ON 2
#define BATT_LED_OFF 3


Copying those to the front of main.cpp produced this in the next build:
CODE
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_test\sdltest.cpp:543: error: 'SDL_SYS_JoystickGp2xSys' was not declared in this scope
C:\Documents and Settings\Owner\My Documents\PROJECTS\SDL_test\sdltest.cpp:544: error: 'SDL_SYS_JoystickGp2xSys' was not declared in this scope
:: === Build finished: 2 errors, 0 warnings ===


That looks like the FUNCTIONS inside "SDL_joystick.h" aren't being seen either, which is tantamount to saying it's just not included.

Dimacus
I put an H at the front of that link but RapidShare still gives me no file to download, just asks if I have one to upload or want to join.
 
Last edited by a moderator:
SDL.h already includes SDL_joystick.h. Can you post screenshots of ALL the tabs under "Search Directories" in your compiler settings?

Also double check that you are actually using the right compiler in your project settings.
 
PokeParadox said:
Try Cleaning the project and then building!
Thanks - I found that one he he he.

What's strange is I can get your project to build.

Dimacus/yaustar - maybe you can zip up your devkitGP2X, codeblocks + application data \ codeblocks and rapidshare them. This is getting stupid. If I'm kinda frustrated, I feel sorry for you guys trying to help me.

Here's the REBUILD of PokeParadox's stuff...
CODE
-------------- Build: Release in SDLGP2XTest ---------------
Compiling: BaseState.cpp
Compiling: Colour.cpp
Compiling: Engine.cpp
Compiling: Fixed.cpp
Compiling: Image.cpp
Compiling: InputHandler.cpp
Compiling: IntVector2d.cpp
Compiling: Random.cpp
Compiling: CENSORED_NAME.cpp
Compiling: CENSORED_NAME.cpp
Compiling: Sprite.cpp
Compiling: StateMain.cpp
Compiling: StateManager.cpp
Compiling: StateTitle.cpp
Compiling: Timer.cpp
Compiling: main.cpp
Linking console executable: bin\Release\SDLGP2XTest.exe
Process terminated with status 0 (0 minutes, 3 seconds)
0 errors, 0 warnings
 
Last edited by a moderator:
QUOTE
devkitGP2X, codeblocks + application data \ codeblocks

To me, that is 2 gig given my entire toolchains

If you can get VNC installed, I can remote connect and dig to see what your problem is.
 
If you can use http://www.tightvnc.com/ instead, that way I know I can connect. Don't forget to forward the ports.

Also, if you can reduce your resolution to 1024x768, that would be VERY helpful .. I have a small screen :(
 
Back
Top