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 

kernel unresolved externals

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



Joined: 09 Jul 2005
Posts: 9

PostPosted: Thu Sep 22, 2005 2:55 am    Post subject: kernel unresolved externals Reply with quote

Hi. I am building a project based on different libraries and at this point I am getting some unresolved externals that I can't find a way to fix them. I get this:

/usr/local/pspdev/lib/gcc/psp/4.0.1/../../../../psp/lib/libc.a(_Exit.o): In function `_exit':
../../../../../../newlib/libc/sys/psp/libcglue.c:563: undefined reference to `sceKernelSelfStopUnloadModule'
../../../../../../newlib/libc/sys/psp/libcglue.c:570: undefined reference to `sceKernelExitThread'
/usr/local/pspdev/lib/gcc/psp/4.0.1/../../../../psp/lib/libc.a(_sbrk.o): In function `_sbrk':
../../../../../../newlib/libc/sys/psp/libcglue.c:406: undefined reference to `sceKernelAllocPartitionMemory'
../../../../../../newlib/libc/sys/psp/libcglue.c:408: undefined reference to `sceKernelGetBlockHeadAddr'
../../../../../../newlib/libc/sys/psp/libcglue.c:402: undefined reference to `sceKernelMaxFreeMemSize'
/usr/local/pspdev/lib/gcc/psp/4.0.1/../../../../psp/lib/libc.a(_sbrk.o): In function `__psp_free_heap':
../../../../../../newlib/libc/sys/psp/libcglue.c:428: undefined reference to `sceKernelFreePartitionMemory'
/usr/local/pspdev/lib/gcc/psp/4.0.1/../../../../psp/lib/libc.a(_write.o): In function `_write':
../../../../../../newlib/libc/sys/psp/libcglue.c:227: undefined reference to `sceIoWrite'
../../../../../../newlib/libc/sys/psp/libcglue.c:216: undefined reference to `sceKernelStdin'
../../../../../../newlib/libc/sys/psp/libcglue.c:218: undefined reference to `sceKernelStdout'
../../../../../../newlib/libc/sys/psp/libcglue.c:220: undefined reference to `sceKernelStderr'
/usr/local/pspdev/lib/gcc/psp/4.0.1/../../../../psp/lib/libc.a(_close.o): In function `_close':
../../../../../../newlib/libc/sys/psp/libcglue.c:176: undefined reference to `sceKernelStdout'
../../../../../../newlib/libc/sys/psp/libcglue.c:178: undefined reference to `sceKernelStderr'
../../../../../../newlib/libc/sys/psp/libcglue.c:174: undefined reference to `sceKernelStdin'
/usr/local/pspdev/lib/gcc/psp/4.0.1/../../../../psp/lib/libc.a(_lseek.o): In function `_lseek':
../../../../../../newlib/libc/sys/psp/libcglue.c:249: undefined reference to `sceIoLseek'
../../../../../../newlib/libc/sys/psp/libcglue.c:237: undefined reference to `sceKernelStdin'
../../../../../../newlib/libc/sys/psp/libcglue.c:239: undefined reference to `sceKernelStdout'
../../../../../../newlib/libc/sys/psp/libcglue.c:241: undefined reference to `sceKernelStderr'
/usr/local/pspdev/lib/gcc/psp/4.0.1/../../../../psp/lib/libc.a(_read.o): In function `_read':
../../../../../../newlib/libc/sys/psp/libcglue.c:195: undefined reference to `sceKernelStdin'
../../../../../../newlib/libc/sys/psp/libcglue.c:197: undefined reference to `sceKernelStdout'
../../../../../../newlib/libc/sys/psp/libcglue.c:199: undefined reference to `sceKernelStderr'

My toolchain is the last version, and I've been messing around with the Makefile for a long time but can't find a way to fix this. All the libraries compile without any complain. The makefile looks like this:

PSPSDK = $(shell psp-config --pspsdk-path)
TARGET = ZombieStation
OBJS = ZombieStation.o ZombieStationPSP.o Application.o ApplicationPSP.o ApplicationMode.o
LIBDIR = ./Core ./Display ./Game ./GUI ./Input ./Tests
INCDIR = $(LIBDIR)
LIBS = -lZombieTests -lZombieCore -lZombieGame -lZombieGUI -lZombieInput -lZombieDisplay -lpspgu

CFLAGS = -G0 -Wall -O2
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LDFLAGS =

include $(PSPSDK)/lib/build.mak

ifneq ($VS_PATH),)
CC = psp-g++
endif

I've used the search on the forums to see if anybody else had the same problem and all but still can't find a solution. Does anybody have any idea about what can I be doing wrong? Thanks in advance.
And congratulations for the excellent work on the sdk.
Back to top
View user's profile Send private message
Zeta



Joined: 09 Jul 2005
Posts: 9

PostPosted: Sat Sep 24, 2005 2:15 am    Post subject: Reply with quote

Just in case anybody has this problem in the future, I fixed it changing a makefile line to look like this:

LIBS = -lc -lZombieTests -lZombieCore -lZombieGame -lZombieGUI -lZombieInput -lZombieDisplay -lpspgu

I'm not very used to makefiles and it seems like the order of the libraries is very important.

Also I would like you to know that trying to fix this I deleted the whole /usr/local/pspdev directory, then downloaded the psptoolchain from svn on psp/trunk/psptoolchain and tried to install it but it resulted on an error while compiling a gdb project, reporting that the libintl.a was missing. I don't know if it's important or not since it's not an official release but I just wanted to warn you.

Thanks
Back to top
View user's profile Send private message
chp



Joined: 23 Jun 2004
Posts: 313

PostPosted: Sat Sep 24, 2005 4:08 am    Post subject: Reply with quote

Yeah, order is very important when using the gnu linker. People who come from other environments where this isn't the case get hit by it a bit before they figure it out.
_________________
GE Dominator
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