well, I want to use Object Oriented Programming so I took my program (that compiles just great in C), changed it to .cpp, added my classes, added -lstdc++ to the makefile and what happened? I can't compile anymore! It gives me undefined references when linking I think. See the errors:
Code: Select all
1>C:/pspsdk/bin/rm -f mouseconf.elf framebuffer.o graphics.o sioDriver.o main.o pgeFont.o PARAM.SFO EBOOT.PBP EBOOT.PBP
1>psp-gcc -I. -IC:/pspsdk/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION=150 -c -o framebuffer.o framebuffer.c
1>psp-gcc -I. -IC:/pspsdk/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION=150 -c -o graphics.o graphics.c
1>psp-gcc -I. -IC:/pspsdk/psp/sdk/include -O2 -G0 -Wall -I. -IC:/pspsdk/psp/sdk/include -O2 -G0 -Wall -c -o sioDriver.o sioDriver.S
1>psp-g++ -I. -IC:/pspsdk/psp/sdk/include -O2 -G0 -Wall -I. -IC:/pspsdk/psp/sdk/include -O2 -G0 -Wall -fno-exceptions -fno-rtti -D_PSP_FW_VERSION=150 -c -o main.o main.cpp
1>psp-gcc -I. -IC:/pspsdk/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION=150 -c -o pgeFont.o pgeFont.c
1>psp-gcc -I. -IC:/pspsdk/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION=150 -L. -LC:/pspsdk/psp/sdk/lib framebuffer.o graphics.o sioDriver.o main.o pgeFont.o -lpspgum -lpspgu -lpng -lz -lm -lfreetype -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o mouseconf.elf
1>main.o: In function `get_input_thread(unsigned int, void*)':
1>main.cpp:(.text+0x168): undefined reference to `sioPutchar(int)'
1>main.cpp:(.text+0x18c): undefined reference to `sioReadChar()'
1>main.cpp:(.text+0x1a4): undefined reference to `sioReadChar()'
1>main.cpp:(.text+0x204): undefined reference to `sioReadChar()'
1>main.cpp:(.text+0x214): undefined reference to `sioReadChar()'
1>main.cpp:(.text+0x28c): undefined reference to `resetFBuf()'
1>main.o: In function `initSerialPort()':
1>main.cpp:(.text+0x430): undefined reference to `sioInit(int)'
1>main.o: In function `main':
1>main.cpp:(.text+0x600): undefined reference to `loadImage(char const*)'
1>main.cpp:(.text+0x614): undefined reference to `loadImage(char const*)'
1>main.cpp:(.text+0x628): undefined reference to `loadImage(char const*)'
1>main.cpp:(.text+0x638): undefined reference to `loadImage(char const*)'
1>main.cpp:(.text+0x648): undefined reference to `loadImage(char const*)'
1>main.o:main.cpp:(.text+0x658): more undefined references to `loadImage(char const*)' follow
1>main.o: In function `main':
1>main.cpp:(.text+0x69c): undefined reference to `initGraphics()'
1>main.cpp:(.text+0x6b0): undefined reference to `clearScreen(unsigned int)'
1>main.cpp:(.text+0x6d0): undefined reference to `blitAlphaImageToScreen(int, int, int, int, Image*, int, int)'
1>main.cpp:(.text+0x6d8): undefined reference to `FadeScreen(int)'
1>main.cpp:(.text+0x6f4): undefined reference to `flipScreen()'
1>main.cpp:(.text+0x710): undefined reference to `flipScreen()'
1>main.cpp:(.text+0x784): undefined reference to `clearScreen(unsigned int)'
1>main.cpp:(.text+0x7a8): undefined reference to `blitAlphaImageToScreen(int, int, int, int, Image*, int, int)'
1>main.cpp:(.text+0x808): undefined reference to `blitAlphaImageToScreen(int, int, int, int, Image*, int, int)'
1>main.cpp:(.text+0x810): undefined reference to `guStart()'
1>main.cpp:(.text+0x97c): undefined reference to `blitAlphaImageToScreen(int, int, int, int, Image*, int, int)'
1>main.cpp:(.text+0x98c): undefined reference to `flipScreen()'
1>main.cpp:(.text+0x99c): undefined reference to `FadeScreen(int)'
1>main.cpp:(.text+0x9b0): undefined reference to `flipScreen()'
1>main.cpp:(.text+0x9d8): undefined reference to `blitAlphaImageToScreen(int, int, int, int, Image*, int, int)'
1>main.cpp:(.text+0xa00): undefined reference to `blitAlphaImageToScreen(int, int, int, int, Image*, int, int)'
Code: Select all
TARGET = mouseconf
OBJS = framebuffer.o graphics.o sioDriver.o main.o pgeFont.o
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBS = -lpspgum -lpspgu -lpng -lz -lm -lfreetype
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Mouse Config
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
as you can see there are only errors in the stub and the graphics thing, pgeFont doesn't drop any error
pls help
TD