Ohhh clickable smileys(...sorry). I find myself getting more bemused by the second with the choices of devkits, I didn't expect it to be a piece of cake. All I wanted was a simple/free c/c++ compiler with an easy to use IDE. I started wth minigw where I have been stepping forwards and backwards ever since(damn makefiles, f**king spaces). The option I tried today was devkitadv ok I lose the IDE but I'm not afraid of notepad, and there is bound to be a few programmers editors out there. OK theres only a c example there, fine I think i'll stick to C. I thought get a little example running then I get "undefined reference to `cos'". Whats happened to math.h or stdio.h for that matter. I guess what I'm really asking is how different is writing C/C++ programs for the GP32 than say the PC, then I can ignore the differences and concentrate on the similarities i.e.
why can't I do this on a GP32
#include <iostream.h>
int main()
{
cout << "Hello, World\n";
return -1;
}
Instead I get this as an example
#ifndef __gpmain_h__
#define __gpmain_h__
void GpMain(void * arg);
int nflip, ExKey;
GPDRAWSURFACE gpDraw[2]; /* buffers */
#endif /*__gpmain_h__*/
/*
test program
*/
#include <stdlib.h>
#include "gpdef.h"
#include "gpstdlib.h"
#include "gpgraphic.h"
#include "gpmain.h"
#include "gpstdio.h"
#include "gpfont.h"
void GpMain(void *arg)
{
int i;
GpClockSpeedChange(132000000, 0x24001, 2); /* speed = 133 Mhz */
nflip = 1;
/* Enable and clear LCD screen */
for(i = 0; i < 2 ; i++)
{
GpLcdSurfaceGet(&gpDraw, i);
}
GpRectFill(NULL, &gpDraw[nflip], 0, 0, gpDraw[nflip].buf_w, gpDraw[nflip].buf_h, 0xff);
GpSurfaceSet(&gpDraw[0]);
srand(36547); /* seed random numbers */
while(1)
{
GpTextOut(NULL, &gpDraw[nflip], 5, 5, "What did you expect? A freaking", 0);
GpTextOut(NULL, &gpDraw[nflip], 5, 21, "Hello World message?", 0);
/* flip the page */
GpSurfaceFlip(&gpDraw[nflip++]);
nflip &= 0x01;
}
}
why can't I do this on a GP32
#include <iostream.h>
int main()
{
cout << "Hello, World\n";
return -1;
}
Instead I get this as an example
#ifndef __gpmain_h__
#define __gpmain_h__
void GpMain(void * arg);
int nflip, ExKey;
GPDRAWSURFACE gpDraw[2]; /* buffers */
#endif /*__gpmain_h__*/
/*
test program
*/
#include <stdlib.h>
#include "gpdef.h"
#include "gpstdlib.h"
#include "gpgraphic.h"
#include "gpmain.h"
#include "gpstdio.h"
#include "gpfont.h"
void GpMain(void *arg)
{
int i;
GpClockSpeedChange(132000000, 0x24001, 2); /* speed = 133 Mhz */
nflip = 1;
/* Enable and clear LCD screen */
for(i = 0; i < 2 ; i++)
{
GpLcdSurfaceGet(&gpDraw, i);
}
GpRectFill(NULL, &gpDraw[nflip], 0, 0, gpDraw[nflip].buf_w, gpDraw[nflip].buf_h, 0xff);
GpSurfaceSet(&gpDraw[0]);
srand(36547); /* seed random numbers */
while(1)
{
GpTextOut(NULL, &gpDraw[nflip], 5, 5, "What did you expect? A freaking", 0);
GpTextOut(NULL, &gpDraw[nflip], 5, 21, "Hello World message?", 0);
/* flip the page */
GpSurfaceFlip(&gpDraw[nflip++]);
nflip &= 0x01;
}
}