Code: Select all
$ svn diff
Index: psp-setup.c
===================================================================
--- psp-setup.c (revision 1100)
+++ psp-setup.c (working copy)
@@ -169,7 +169,7 @@
{
int id;
pspKernelSetKernelPC();
- pspDebugInstallErrorHandler((void *) 0);
+ pspDebugInstallErrorHandler((PspDebugErrorHandler) (void *) 0);
if ((id = sceKernelCreateThread("update_thread", update_thread, 0x11, 0xFA0, PSP_THREAD_ATTR_USER, 0)) >= 0)
sceKernelStartThread(id, 0, 0);
}
Index: eglcube.c
===================================================================
--- eglcube.c (revision 1082)
+++ eglcube.c (working copy)
@@ -1,3 +1,6 @@
+
+extern "C" {
+
#include <pspctrl.h>
#include <stdlib.h>
#include <stdio.h>
@@ -7,10 +10,11 @@
#include <GLES/egl.h>
#include <GLES/gl.h>
-
extern unsigned char logo_start[];
+};
+
struct Vertex
{
float u, v;
@@ -80,7 +84,7 @@
#define psp_log(x...) __psp_log(x)
#else
#define psp_log(x...) do {} while (0)
- extern void __psp_log (const char *fmt, ...);
+ extern "C" void __psp_log (const char *fmt, ...);
#endif
/* enable GLerror logging to "ms0:/pspgl.ge" */
Index: Makefile
===================================================================
--- Makefile (revision 1049)
+++ Makefile (working copy)
@@ -1,4 +1,5 @@
ARCH = psp-
+CPP = $(ARCH)g++
CC = $(ARCH)gcc
PSP_INSTALL = ../tools/psp-install
RM = rm -f
@@ -6,7 +7,7 @@
PSPPATH := $(shell psp-config --pspsdk-path)
PSPGL_LFLAGS = -lGLU -lGL -lpspdebug -lpspge -lpspdisplay -lpspctrl -lpspsdk -lm -lc -lpspuser -lpspkernel
CFLAGS = -g -Wall -O2 -MD -I$(PSPPATH)/include -I..
-LFLAGS = -g -Wall -O2 -DMODULE_NAME="test-egl" psp-setup.c -L$(PSPPATH)/lib -L.. $(PSPGL_LFLAGS)
+LFLAGS = -g -Wall -O2 -DMODULE_NAME="test-egl" psp-setup.c -L$(PSPPATH)/lib -L.. -lstdc++ $(PSPGL_LFLAGS)
TARGET = pspGL-cube
OBJS = eglcube.o logo.o
@@ -19,7 +20,7 @@
all: $(TARGET)
.c.o:
- $(CC) $(CFLAGS) -c $<
+ $(CPP) $(CFLAGS) -c $<
logo.o: logo.raw
bin2o -i logo.raw logo.o logo
And it compiles like this
Code: Select all
$ make
psp-g++ -g -Wall -O2 -MD -I/usr/local/pspdev/psp/sdk/include -I.. -c eglcube.cpp
bin2o -i logo.raw logo.o logo
psp-gcc eglcube.o logo.o -g -Wall -O2 -DMODULE_NAME="test-egl" psp-setup.c -L/usr/local/pspdev/psp/sdk/lib -L.. -lstdc++ -lGLU -lGL -lpspdebug -lpspge -lpspdisplay -lpspctrl -lpspsdk -lm -lc -lpspuser -lpspkernel -o pspGL-cube