Just started - Please read

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
GORETHRASHER
Posts: 12
Joined: Wed Sep 10, 2008 12:28 pm

Just started - Please read

Post by GORETHRASHER »

Hi, I have finally managed to get a development environment set-up for the PSP.

I found Heimdall's post on the windows native toolchain, so I set it up last night. I am quite impressed, using the eclipse IDE you can get a pretty decent environment going.

I even managed to compile pspGL using eclipse, although you need a workaround, which I can detail later if anyone is interested.

So my question.

I tried creating a class

Code: Select all

class nodeGE
{

public:
	nodeGE() { m_parent = NULL; }
	nodeGE( nodeGE* node ) { m_child = node; }
	~nodeGE();

	void init();

	void setPos( int x, int y, int z );
	void setPos( ScePspIVector3* vector );

	void setRotation( int x, int y, int z );
	void setRotation( ScePspIVector3* vector );

	void setScale( int x, int y, int z );
	void setScale( ScePspIVector3* vector );

private:
	nodeGE* m_child;
	ScePspIVector3 m_iv3_pos;
	ScePspIVector3 m_iv3_rotation;
	ScePspIVector3 m_iv3_scale;
};

which gives me an error

Code: Select all

make all 
psp-gcc -I. -IC:/pspsdk/psp/sdk/include -G0 -Wall -D_PSP_FW_VERSION=150   -c -o main.o main.c
In file included from objectGE.h:5,
                 from main.c:18:
nodeGE.h:6: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'nodeGE'
In file included from main.c:18:
I am suspecting I am missing some psp specific code.
Noko
Posts: 23
Joined: Sat Sep 06, 2008 8:35 pm

Post by Noko »

m_parent
GORETHRASHER
Posts: 12
Joined: Wed Sep 10, 2008 12:28 pm

Post by GORETHRASHER »

Indeed, that was an error in the code, but it's not what is causing the compile error. Even with an empty class

Code: Select all

class nodeGE
{

public:
	nodeGE() { }
	~nodeGE(){ }
};
It gives the same error

Is there a difference in the compiler used for C and C++ ?

Here is the makefile if it helps

Code: Select all

TARGET = lesson2
OBJS = main.o

CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

PSPBIN = $(PSPSDK)/../bin
CFLAGS += -I$(PSPSDK)/../include  -fsingle-precision-constant -g -Wall -O2 
LIBS += -lglut -lGLU -lGL -lm -lc -lpsputility -lpspdebug -lpspge -lpspdisplay -lpspctrl -lpspsdk -lpspvfpu -lpsplibc -lpspuser -lpspkernel -lpsprtc -lpsppower -lstdc++
LDFLAGS += -DMODULE_NAME="lesson2" psp-setup.c


EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = LESSON2
# PSP_EBOOT_ICON = hero.png
# PSP_EBOOT_PIC1 = bg.png


PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
GORETHRASHER
Posts: 12
Joined: Wed Sep 10, 2008 12:28 pm

Post by GORETHRASHER »

Turns out I was using a C project to try and compile C++ code.

Using a C++ project in eclipse now compiles my code.
cheriff
Regular
Posts: 258
Joined: Wed Jun 23, 2004 5:35 pm
Location: Sydney.au

Post by cheriff »

Is your file named main.c? It looks like you're using psp-gcc to compile, not psp-g++. And since that isn't C code in there, might be confusing the compiler?
I guess .cc or .cpp or something will invoke the g++ rules in the Makefiles ...

EDIT: beaten to it :)
Damn, I need a decent signature!
Post Reply