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 

Ehh? Can the toolchain compile C++?

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



Joined: 16 Dec 2006
Posts: 11

PostPosted: Mon Jan 22, 2007 3:27 pm    Post subject: Ehh? Can the toolchain compile C++? Reply with quote

I try to use some C++ feature such as "new" or "Class",
but the source code cannot be compiled?

In case of "new" it said error: 'new' undeclared ,first use...
As i understand the gcc can compile both c and c++ isn'it?
Or do i need to use some flag of compilation?
my current make file is..
===========================================
TARGET = MyDemo
OBJS = main.o graphics.o framebuffer.o game.o

CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
===========================================
(copy from the tutorial.)

And if it use some additional flag to compile C++,
will the result file can run on psp machine normaly?

thanks
Back to top
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Mon Jan 22, 2007 5:06 pm    Post subject: Reply with quote

Use g++ for C++ programs. You'll also need to link with g++. Note that the default build.mak with the pspsdk uses $(LINK.c) to link the elf, so you'll have to write your own linker rule or redefine LINK.c=$(LINK.cc).
Back to top
View user's profile Send private message
cp25stack



Joined: 16 Dec 2006
Posts: 11

PostPosted: Mon Jan 22, 2007 11:15 pm    Post subject: Reply with quote

thanks, at this state i can clear this problem, using makefile from GU tutorial. it can compile c++ code but i still not sure about the Link.cc as you said (i still not test the result, because it is a littlebit difficult for me to use the computer :P)
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