forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Just started - Please read

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
GORETHRASHER



Joined: 10 Sep 2008
Posts: 12

PostPosted: Thu Sep 11, 2008 11:52 am    Post subject: Just started - Please read Reply with quote

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:

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:

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.
Back to top
View user's profile Send private message
Noko



Joined: 06 Sep 2008
Posts: 23

PostPosted: Thu Sep 11, 2008 3:46 pm    Post subject: Reply with quote

m_parent
Back to top
View user's profile Send private message
GORETHRASHER



Joined: 10 Sep 2008
Posts: 12

PostPosted: Thu Sep 11, 2008 3:57 pm    Post subject: Reply with quote

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

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:

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
Back to top
View user's profile Send private message
GORETHRASHER



Joined: 10 Sep 2008
Posts: 12

PostPosted: Thu Sep 11, 2008 4:22 pm    Post subject: Reply with quote

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

Using a C++ project in eclipse now compiles my code.
Back to top
View user's profile Send private message
cheriff
Regular


Joined: 23 Jun 2004
Posts: 262
Location: Sydney.au

PostPosted: Thu Sep 11, 2008 4:24 pm    Post subject: Reply with quote

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!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group