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?
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).
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)