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 

Linker error problems with pspgl

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



Joined: 03 Nov 2005
Posts: 21

PostPosted: Mon Nov 07, 2005 7:11 am    Post subject: Linker error problems with pspgl Reply with quote

I ran the demo sprite program that Jsgf wrote with pspgl, and think it's a good step forward to creating nicer-looking 2D homebrew games.

After downloading the pspgl source archive from goop.org, and putting it in the appropriate pspdev/psp/include directory, I tried compiling the source code for the demo program. I get a linker error

Code:
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/bin/ld: cannot find -glut
collect2: ld returned 1 exit status
make: *** [sprite-test.elf] Error 1


I probably didn't install the pspgl files correctly. When creating programs for PC, installation of OpenGL was smooth for me, but I'm not sure where to start fixing this problem. The makefile that came with the source for the program hasn't been altered.
Back to top
View user's profile Send private message
jsgf



Joined: 12 Jul 2005
Posts: 254

PostPosted: Mon Nov 07, 2005 10:35 am    Post subject: Reply with quote

Hm. Can you show the full output? It should say "-lglut" on the link line.
Back to top
View user's profile Send private message Visit poster's website
JustChris



Joined: 03 Nov 2005
Posts: 21

PostPosted: Mon Nov 07, 2005 1:02 pm    Post subject: Reply with quote

(Edit)
Full error message



This is the makefile. Again, it's unaltered.
Code:
TARGET = sprite-test
OBJS = test.o sprite.o psp-setup.o sprite-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 = Sprite Test
PSP_EBOOT_ICON = rabbit.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.c sprite.h
test.o: test.c 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
Back to top
View user's profile Send private message
jsgf



Joined: 12 Jul 2005
Posts: 254

PostPosted: Mon Nov 07, 2005 3:27 pm    Post subject: Reply with quote

So you built a recent goop.org (or now, SVN) version and did "make install"? It looks like you don't have libglut.a in /usr/local/pspdev/psp/sdk/lib.
Back to top
View user's profile Send private message Visit poster's website
JustChris



Joined: 03 Nov 2005
Posts: 21

PostPosted: Mon Nov 07, 2005 4:05 pm    Post subject: Reply with quote

jsgf wrote:
So you built a recent goop.org (or now, SVN) version and did "make install"? It looks like you don't have libglut.a in /usr/local/pspdev/psp/sdk/lib.


I think that's the problem. I didn't do "make install" because I didn't know from which directory I should be doing that in the shell. I assumed installing was as simple as placing the .h files in the psp/sdk/include directory. Where should I run the "make install" command after unzipping the pspgl source?
Back to top
View user's profile Send private message
jsgf



Joined: 12 Jul 2005
Posts: 254

PostPosted: Mon Nov 07, 2005 6:12 pm    Post subject: Reply with quote

In the top directory (where the Makefile and all the gl*.c and other source files are). In addition to installing the .h files, you also need to install the *.a files which are the actual libraries themselves.
Back to top
View user's profile Send private message Visit poster's website
mrbrown



Joined: 17 Jan 2004
Posts: 1536

PostPosted: Mon Nov 07, 2005 8:18 pm    Post subject: Reply with quote

Wait .. pspgl should be installed in /psp/lib (and /psp/include), not /psp/sdk/lib. Only PSPSDK goes into /psp/sdk/lib.

I've checked in a change that installs it into the correct directory.
Back to top
View user's profile Send private message
jsgf



Joined: 12 Jul 2005
Posts: 254

PostPosted: Tue Nov 08, 2005 3:52 am    Post subject: Reply with quote

Ah, I was wondering about that. Good.
Back to top
View user's profile Send private message Visit poster's website
JustChris



Joined: 03 Nov 2005
Posts: 21

PostPosted: Tue Nov 08, 2005 7:11 am    Post subject: Reply with quote

jsgf wrote:
In the top directory (where the Makefile and all the gl*.c and other source files are). In addition to installing the .h files, you also need to install the *.a files which are the actual libraries themselves.


Okay, I'm gonna try that when I get back to my computer. I'll also get the latest version of pspgl while I'm at it. Sorry, I'm not too savvy with most Unix compiler commands yet.
Back to top
View user's profile Send private message
jsgf



Joined: 12 Jul 2005
Posts: 254

PostPosted: Tue Nov 08, 2005 7:31 am    Post subject: Reply with quote

And if I wasn't clear, "make install" is what you type to do everything; you don't need to copy anything manually.
Back to top
View user's profile Send private message Visit poster's website
JustChris



Joined: 03 Nov 2005
Posts: 21

PostPosted: Tue Nov 08, 2005 3:31 pm    Post subject: Reply with quote

I got it compiled and the examples working. Thanks!
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