Help with pspsdk!

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

Moderators: cheriff, TyRaNiD

Post Reply
everlasting
Posts: 41
Joined: Mon Mar 19, 2007 6:27 pm

Help with pspsdk!

Post by everlasting »

Hi!
I've been all the day trying to make pspsdk work properly under ubuntu 6.10, after solving many problems, the one still belongs is:

I cannot complie any file from /home for example:

root@BIG-BILL:/home/guillermo/cube# make
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -G0 -Wall -D_PSP_FW_VERSION=150 -c -o cube.o cube.c
cube.c:20:33: error: ../common/callbacks.h: No existe el fichero ó directorio
cube.c:21:28: error: ../common/vram.h: No existe el fichero ó directorio
cube.c: En la función ‘main’:
cube.c:93: aviso: declaración implícita de la función ‘setupCallbacks’
cube.c:97: aviso: declaración implícita de la función ‘getStaticVramBuffer’
cube.c:97: aviso: la inicialización crea un puntero desde un entero sin una conversión
cube.c:98: aviso: la inicialización crea un puntero desde un entero sin una conversión
cube.c:99: aviso: la inicialización crea un puntero desde un entero sin una conversión
cube.c:129: aviso: declaración implícita de la función ‘running’
make: *** [cube.o] Error 1


I guess it must have something to do with the path, I set it in /etc/bash.bashrc as follows :
export PSPDEV="/usr/local/pspdev"
export PATH="$PATH:$PSPDEV/bin"

I also put the same in /home/.bashrc and also tried it in /home/.bash_profile but never worked.

The strangest thing is that i can compile every sample of the sdk doing it from:
/usr/local/pspdev/psp/sdk/samples/whatever.

Somebody help please
Djakku
Posts: 45
Joined: Mon Jan 30, 2006 2:41 am

Post by Djakku »

If you can compile properly the sample provided with the SDK maybe something is wrong with your makefile or cube.c file. I'm not a programmer but if you post them someone might be more helpfull
Insert_witty_name
Posts: 376
Joined: Wed May 10, 2006 11:31 pm

Post by Insert_witty_name »

cube.c:20:33: error: ../common/callbacks.h: No existe el fichero ó directorio
cube.c:21:28: error: ../common/vram.h: No existe el fichero ó directorio
If you wish to move files before compiling them, you might want to make sure you take any files it relies on too.
everlasting
Posts: 41
Joined: Mon Mar 19, 2007 6:27 pm

Post by everlasting »

The error messages I posted above are from the compiling process of one of the samples provided with the PSPSDK. I've compiled the same sample placed in /usr/local/pspdev/psp/sdk/samples/gu/cube and everything went all right. That's the reason why i'm thinking about something to do with the path, but i have looked all over the internet and I've used a couple of paths and never work.

As I said i've got ubuntu edgy and i have got a partition for the "/home" directory diferent from the "/" one, may the path should have to be in a particular way for the case you are routing to another partition?
Cy-4AH
Posts: 44
Joined: Wed Jan 31, 2007 9:58 pm
Location: Belarus

Post by Cy-4AH »

everlasting, I'd advised you to write your own functions. Callbacks and Vram just examples.
In Vram.h you can find:
/*
The following are a few helperfunctions to help manage vram in gu-examples.
Do not use for your own code, it's better you manage it in your own way.
*/
But if you still want to use them, try add to CFLAGS in makefile
-I$(PSPSDK)/samples/gu/common
Istari
Posts: 10
Joined: Fri Sep 30, 2005 2:34 am

Post by Istari »

When you copy /usr/local/pspdev/psp/sdk/samples/gu/cube to your home directory you also need to copy /usr/local/pspdev/psp/sdk/samples/gu/common

When your ~ has a copy of common and cube you can run make in the cube directory.

Code: Select all

mkdir -p ~/psptest
cp -a /usr/local/pspdev/psp/sdk/samples/gu/cube ~/psptest
cp -a /usr/local/pspdev/psp/sdk/samples/gu/common ~/psptest
cd psptest/cube
make
everlasting
Posts: 41
Joined: Mon Mar 19, 2007 6:27 pm

Post by everlasting »

Thank you very much Istari, it worked. I'm very grateful. So if i would have copied any sample from any other folder except gu (cause most of them haven't got a common folder) it would have compiled? what a pity! Thanks again
everlasting
Posts: 41
Joined: Mon Mar 19, 2007 6:27 pm

Post by everlasting »

HI Cy-4Ah I'm very new programming the psp and i never made a makefile, i,ve added what you told me so now the makefile looks like this:

TARGET = envmap
OBJS = envmap.o env0.o ../common/callbacks.o ../common/geometry.o ../common/vram.o

INCDIR =
CFLAGS = -G0 -Wall -O2 -I$(PSPSDK)/samples/gu/common
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

LIBDIR =
LDFLAGS =
LIBS= -lpspgum -lpspgu -lm

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Environment Mapping Sample

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak


env0.o: env0.raw
bin2o -i env0.raw env0.o env0


I think this is what you told me to do but i'm not sure if i have to add anything else because it doesn't compile
Cy-4AH
Posts: 44
Joined: Wed Jan 31, 2007 9:58 pm
Location: Belarus

Post by Cy-4AH »

Ok, than try this one:

Code: Select all

TARGET = envmap
PSPSDK=$(shell psp-config --pspsdk-path) 
COMMDIR=$(PSPSDK)/samples/gu/common
OBJS = envmap.o env0.o $(COMMDIR)/callbacks.o $(COMMDIR)/geometry.o $(COMMIR)/vram.o 

INCDIR = 
CFLAGS = -G0 -Wall -O2 -I$(COMMDIR) 
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 
ASFLAGS = $(CFLAGS) 

LIBDIR = 
LDFLAGS = 
LIBS= -lpspgum -lpspgu -lm 

EXTRA_TARGETS = EBOOT.PBP 
PSP_EBOOT_TITLE = Environment Mapping Sample 

include $(PSPSDK)/lib/build.mak 


env0.o: env0.raw 
bin2o -i env0.raw env0.o env0
There is exist more beautiful way indication of object files, but I don't know how:)
Istari
Posts: 10
Joined: Fri Sep 30, 2005 2:34 am

Post by Istari »

This is probably the most comprehensive, free, reference you can get for make and makefiles.
http://www.gnu.org/software/make/manual/make.html
Post Reply