Caanoo / WIZ Wiz Sdk Install On Linux


ulula

Still Fresh
Joined
Jan 9, 2009
Messages
41
Age
41
Location
amiens
Hi all

I am a newbi in GP2X/WIZ dev and i had few question :
- where i can found WIZ SDK
- which version i should use (open2x, openwiz, ...)
- how to configure CodeBlocks or Eclipse for using GP2X compiler
- how to dynamic linking library like SDL

In first time, my objectif is to create a "casse brique" game for be more familiarize with WIZ dev.

thank to help
 
- how to configure CodeBlocks or Eclipse for using GP2X compiler
- how to dynamic linking library like SDL

In first time, my objectif is to create a "casse brique" game for be more familiarize with WIZ dev.

thank to help
openwiz: http://archive.gp2xwiz.de/cgi-bin/cfiles.cgi?0,0,0,0,14,8
you can use open2x too, look around theres a thread on how to.
for codeblocks you really just need to point it to the binaries, look at the gcc compilier, or download the gp2x prebuilt package and look at how that was setup. its not difficult
to dynamic link just dont use -static, on the otherhand use -static to link statically
 
Last edited by a moderator:
thank for help !

i have install openwiz sdk in "opt/openwiz" and configure codeblock.
but when i build an sample SDL example i obtain the following error :
CODE

-------------- Build: Debug in sdl_sample ---------------

Linking console executable: bin/Debug/sdl_sample
/opt/openwiz/arm-openwiz-linux-gnu/bin/../lib/gcc/arm-openwiz-linux-gnu/4.2.4/../../../../arm-openwiz-linux-gnu/bin/ld: skipping incompatible /usr/lib/libSDL.so when searching for -lSDL
/opt/openwiz/arm-openwiz-linux-gnu/bin/../lib/gcc/arm-openwiz-linux-gnu/4.2.4/../../../../arm-openwiz-linux-gnu/bin/ld: skipping incompatible /usr/lib/libSDL.a when searching for -lSDL
/opt/openwiz/arm-openwiz-linux-gnu/bin/../lib/gcc/arm-openwiz-linux-gnu/4.2.4/../../../../arm-openwiz-linux-gnu/bin/ld: cannot find -lSDL
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
1 errors, 0 warnings


i am using the default sdl path "/usr/include/SDL", may be i should use and another version of SDL

sample sdl example
CODE

#ifdef __cplusplus
#include <cstdlib>
#else
#include <stdlib.h>
#endif
#ifdef __APPLE__
#include <SDL/SDL.h>
#else
#include <SDL.h>
#endif

int main ( int argc, char** argv )
{
// initialize SDL video
if ( SDL_Init( SDL_INIT_VIDEO ) < 0 )
{
printf( "Unable to init SDL: %s\n", SDL_GetError() );
return 1;
}

// make sure SDL cleans up before exit
atexit(SDL_Quit);

// create a new window
SDL_Surface* screen = SDL_SetVideoMode(640, 480, 16,
SDL_HWSURFACE|SDL_DOUBLEBUF);
if ( !screen )
{
printf("Unable to set 640x480 video: %s\n", SDL_GetError());
return 1;
}

// load an image
SDL_Surface* bmp = SDL_LoadBMP("cb.bmp");
if (!bmp)
{
printf("Unable to load bitmap: %s\n", SDL_GetError());
return 1;
}

// centre the bitmap on screen
SDL_Rect dstrect;
dstrect.x = (screen->w - bmp->w) / 2;
dstrect.y = (screen->h - bmp->h) / 2;

// program main loop
bool done = false;
while (!done)
{
// message processing loop
SDL_Event event;
while (SDL_PollEvent(&event))
{
// check for messages
switch (event.type)
{
// exit if the window is closed
case SDL_QUIT:
done = true;
break;

// check for keypresses
case SDL_KEYDOWN:
{
// exit if ESCAPE is pressed
if (event.key.keysym.sym == SDLK_ESCAPE)
done = true;
break;
}
} // end switch
} // end of message processing

// DRAWING STARTS HERE

// clear screen
SDL_FillRect(screen, 0, SDL_MapRGB(screen->format, 0, 0, 0));

// draw bitmap
SDL_BlitSurface(bmp, 0, screen, &dstrect);

// DRAWING ENDS HERE

// finally, update the screen :)
SDL_Flip(screen);
} // end main loop

// free loaded bitmap
SDL_FreeSurface(bmp);

// all is well ;)
printf("Exited cleanly\n");
return 0;
}
 
I've seen codeblocks add a library search path to /usr/lib/ by default for custom compilers. You might want to remove that:
Settings -> compiler and debugger ... -> select your compiler -> search directories
Make sure those 3 tabs are empty.

Also, if you select the last tab, there is an option to show the full command line, if you enable that it helps to see what is going on.
 
i have found a great tutorial for install codeblocks
I had just to change compiler path like this :
Capture.png


and add include, lib path to "search directory".

now i will try it on my WIZ
 
Peter R posted on May 18 2009 at 09:07 PM said:
If it all works then please feel free to add a full tutorial to the Wiz Wiki.
that a good idea but i don't think my english level is enough high to write a tutorial.
i can write it in french
 
Last edited by a moderator:
excellent, for some reason I was under the impression that codeblocks was windows only. Installing now and I'll set it up tomorrow. Is anyone planning on porting python to the wiz? .. also I'll take a stab at compiling stella, since it's code seemed clean. (didn't read the code itself, but observed the build environment which seemed good)
 
Hi guys!

Do you recommend Codeblocks over Dev-cpp from the previous SDK? Is there anyway to use this libs and compile from Dev-cpp? I think Dev-cpp is not being very updated... but I've my BugaFactorX (A forgotten project hehe) in dev-cpp and maybe it easier for me use it to compile for wiz also. Is codeblocks a better option? It seems cool anyway :)

By the way you have a little recopilation of SDK download links in:
http://gp2x-wiz.net/homebrew/sdk-oficial-para-gp2x-wiz/

Is in spanish but could be usefull. The GPain links are bloodly slow :S

Saludos! =)
 
Back
Top