Code: Select all
int *ptr;
ptr = new int[10];
// error returned
main.cpp:(.text+0x5a30): Undefined reference to 'operator new[](unsigned int)'
Code: Select all
TARGET = Test
OBJS = main.o sprite.o psp-setup.o sprite-rgba.o map1-rgba.o sprite-mono.o
INCDIR =
CFLAGS = -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =
LDFLAGS =
LIBS = -lglut -lGL -lm -lpsprtc
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Testing
PSP_EBOOT_ICON = test.png
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
AS=psp-as
psp-setup.o: psp-setup.c Makefile
psp-setup.o: CFLAGS += -DMODULE_NAME="$(TARGET)"
sprite.o: sprite.cpp sprite.h
main.o: main.cpp sprite.h
%.o: %.raw
(sym=`echo $* | tr '-' '_'`; \
echo -e ".data\n.global $${sym}_start\n$${sym}_start:\n\t.incbin \"$<\"" | $(AS) -o $@)
%-rgba.raw: %-rgba.png
convert $< rgba:$@
%-mono.raw: %-mono.png
convert $< gray:$@
%-sys.o: %.c
gcc -g -Wall -DSYS -c -o $@ $<
sys: test-sys.o sprite-sys.o sprite-mono.o sprite-rgba.o
gcc -o sys $^ -lglut