| View previous topic :: View next topic |
| Author |
Message |
JustChris
Joined: 03 Nov 2005 Posts: 21
|
Posted: Mon Nov 07, 2005 7:11 am Post subject: Linker error problems with pspgl |
|
|
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 |
|
 |
jsgf
Joined: 12 Jul 2005 Posts: 254
|
Posted: Mon Nov 07, 2005 10:35 am Post subject: |
|
|
| Hm. Can you show the full output? It should say "-lglut" on the link line. |
|
| Back to top |
|
 |
JustChris
Joined: 03 Nov 2005 Posts: 21
|
Posted: Mon Nov 07, 2005 1:02 pm Post subject: |
|
|
(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 |
|
 |
jsgf
Joined: 12 Jul 2005 Posts: 254
|
Posted: Mon Nov 07, 2005 3:27 pm Post subject: |
|
|
| 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 |
|
 |
JustChris
Joined: 03 Nov 2005 Posts: 21
|
Posted: Mon Nov 07, 2005 4:05 pm Post subject: |
|
|
| 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 |
|
 |
jsgf
Joined: 12 Jul 2005 Posts: 254
|
Posted: Mon Nov 07, 2005 6:12 pm Post subject: |
|
|
| 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 |
|
 |
mrbrown
Joined: 17 Jan 2004 Posts: 1536
|
Posted: Mon Nov 07, 2005 8:18 pm Post subject: |
|
|
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 |
|
 |
jsgf
Joined: 12 Jul 2005 Posts: 254
|
Posted: Tue Nov 08, 2005 3:52 am Post subject: |
|
|
| Ah, I was wondering about that. Good. |
|
| Back to top |
|
 |
JustChris
Joined: 03 Nov 2005 Posts: 21
|
Posted: Tue Nov 08, 2005 7:11 am Post subject: |
|
|
| 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 |
|
 |
jsgf
Joined: 12 Jul 2005 Posts: 254
|
Posted: Tue Nov 08, 2005 7:31 am Post subject: |
|
|
| 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 |
|
 |
JustChris
Joined: 03 Nov 2005 Posts: 21
|
Posted: Tue Nov 08, 2005 3:31 pm Post subject: |
|
|
| I got it compiled and the examples working. Thanks! |
|
| Back to top |
|
 |
|