linker error / samples

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
Diddl
Posts: 9
Joined: Tue Mar 27, 2007 7:50 pm

linker error / samples

Post by Diddl »

please excuse my simple question, I'm a beginner in using psp toolchain ...

I have installed devkitpro on a Win XP (Ming) environment for NDS and PSP. the examples for NDS compile and execute fine. but this samples for PSP compiles but give errors while linking (many samples tested).

I think there is a lib file missing but which and why? could you help me? I don't have problems with C but with this Ming and Toolkit Environment.

Code: Select all

$ ls
Makefile  main.c  main.o

tw@TOMMY /D/Proj/PSP/samples/audio/polyphonic
$ make
psp-gcc -I. -I/d/Programme/devkitPro/devkitPSP/psp/sdk/include -O2 -G0 -Wall -D_
PSP_FW_VERSION=150  -L. -L/d/Programme/devkitPro/devkitPSP/psp/sdk/lib   main.o
-lpspaudiolib -lpspaudio -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc
-lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -
lpspkernel -o polyphonic.elf
main.o: In function `main':
main.c:(.text+0x558): undefined reference to `pspDebugScreenInit'
main.c:(.text+0x56c): undefined reference to `pspDebugScreenPrintf'
main.c:(.text+0x578): undefined reference to `pspDebugScreenPrintf'
main.c:(.text+0x584): undefined reference to `pspDebugScreenPrintf'
main.c:(.text+0x590): undefined reference to `pspDebugScreenPrintf'
collect2: ld returned 1 exit status
make: *** [polyphonic.elf] Error 1

tw@TOMMY /D/Proj/PSP/samples/audio/polyphonic
$
User avatar
dot_blank
Posts: 498
Joined: Wed Sep 28, 2005 8:47 am
Location: Brasil

Post by dot_blank »

//link pspdebug with
LDFLAGS += -lpspdebug
//and check your include of
#include <pspdebug.h>
10011011 00101010 11010111 10001001 10111010
Diddl
Posts: 9
Joined: Tue Mar 27, 2007 7:50 pm

Post by Diddl »

thanks for answer.

libfile libpspdebug.a is in folder /d/Programme/devkitPro/devkitPSP/psp/sdk/lib and make utility already uses -L/d/Programme/devkitPro/devkitPSP/psp/sdk/lib and -lpspdebug

so I don't understand why linker won't bind this lib and resolve this externals?
User avatar
dot_blank
Posts: 498
Joined: Wed Sep 28, 2005 8:47 am
Location: Brasil

Post by dot_blank »

// well check that your path is pointing to this
/d/Programme/devkitPro/devkitPSP/psp/sdk/lib

right click My Computer->Properties, Advanced TAB->Enviroment Variables
on the bottom of window that pops up you should see System Variables
scroll window to where you see Path for Variable, now click EDIT button
then add ; after last directory then paste

/d/Programme/devkitPro/devkitPSP/psp/sdk/lib;
// and
/d/Programme/devkitPro/devkitPSP/psp/sdk/include;

it should be something similar to like C:\DEVKITPRO\DEVKITPSP\psp\sdk\lib
and C:\DEVKITPRO\DEVKITPSP\psp\sdk\include;

i dont use devkitpsp so wouldnt know but it should be something very similar
to this
10011011 00101010 11010111 10001001 10111010
PeterM
Posts: 125
Joined: Sat Dec 31, 2005 7:25 pm
Location: Edinburgh, UK
Contact:

Post by PeterM »

Hi,

Have you had any luck with this? I tried switching to devkitPSP too, but ran into the same problem. My path and all that is fine, it's finding the libraries, they just don't seem to have the functions in them.

Looks like the supplied PSPSDK is old, but I'd like to verify that.

Pete
http://aaiiee.wordpress.com/

I can no longer do any homebrew PSP development nor discuss PSP specific topics.
Diddl
Posts: 9
Joined: Tue Mar 27, 2007 7:50 pm

Post by Diddl »

PeterM wrote:Hi,
Looks like the supplied PSPSDK is old, but I'd like to verify that.

cannot believe it is old. I'm using newest available (v10). and the point is, this example files are included with the kit!

you switch to devkitPSP? which one you use normally? is there a alternative kit available? does this run under windows?
PeterM
Posts: 125
Joined: Sat Dec 31, 2005 7:25 pm
Location: Edinburgh, UK
Contact:

Post by PeterM »

I had a chat with WinterMute, the guy that does devkitPSP. He reckons there's a problem with r10's PSPSDK, which causes the linking errors, and recommends using r9.

R9 worked much fine for the sample apps, but we got sound corruption in Quake. Probably something we're doing rather than a problem in the toolchain, but I couldn't track it down.

He says he's doing a new release soon.

I was using the precompiled setup from http://xorloser.com , but the SDK is from Dec 2006 and is a bit out of date.

In the end I installed cygwin again and updated to the latest PSPSDK from SVN.
http://aaiiee.wordpress.com/

I can no longer do any homebrew PSP development nor discuss PSP specific topics.
WinterMute
Posts: 9
Joined: Tue Jul 05, 2005 12:06 pm
Location: UK
Contact:

Post by WinterMute »

For what it's worth release 11 is now available and gets rid of the linking errors.

I should really check the forums here more often :P
Diddl
Posts: 9
Joined: Tue Mar 27, 2007 7:50 pm

Post by Diddl »

oh thanks for answers! I was in holidays and so I don't see your answers since yesterday.

I will test release 11 today ...
Diddl
Posts: 9
Joined: Tue Mar 27, 2007 7:50 pm

Post by Diddl »

WinterMute wrote:For what it's worth release 11 is now available and gets rid of the linking errors.

I should really check the forums here more often :P
many thanks to wintermute, r11 works fine for me!!
Post Reply