OSK Libraries
OSK Libraries
Hello,
I'm trying to get Danzeff's OSK to work. However, compiling the script does not seem to work (make command). Most of the errors were saying something like "png_bytep_null undeclared" (x undeclared, implicit declaration of x etc etc). I think that the problem is; I don't have the correct libraries (yet).
Does anyone wants to RAR all the libraries which are needed for Danzeff's OSK? I know that they are in the SVN but RAR'ing them makes my life a lot easier.
Thanks already.
:)
EDIT: If anyone could also supply me with a working makefile, I would be even happier!
I'm trying to get Danzeff's OSK to work. However, compiling the script does not seem to work (make command). Most of the errors were saying something like "png_bytep_null undeclared" (x undeclared, implicit declaration of x etc etc). I think that the problem is; I don't have the correct libraries (yet).
Does anyone wants to RAR all the libraries which are needed for Danzeff's OSK? I know that they are in the SVN but RAR'ing them makes my life a lot easier.
Thanks already.
:)
EDIT: If anyone could also supply me with a working makefile, I would be even happier!
Basilisk II for the PSP is a working example of using Danzeff's OSK in a program. You'll find all the files as well as how to use them in the B2 source.
http://groups.google.com/group/chilly-w ... -psp?hl=en
http://groups.google.com/group/chilly-w ... -psp?hl=en
It's not the OSK code which isn't working, it are the libraries;
The compiler can't find them (don't tell me that I'm missing the png and other libs, I'm aware of that, just removed them for testing purposes).C:\pspdev\projects\GPOS>make
psp-gcc -I. -IC:/pspdev/psp/sdk/include -O2 -G0 -Wall -L. -LC:/pspdev/psp/sdk/l
ib danzeff.o main.o -lpspgu -ld -o hello.elf
/cygdrive/c/pspdev/bin/../lib/gcc/psp/4.0.2/../../../../psp/bin/ld: cannot find
-ldcollect2: ld returned 1 exit status
make: *** [hello.elf] Error 1
LIBS = -lstdc++ -lpsprtc -lpspwlan -lpspgum -lpspgu -lpspaudio -lm -lpsppower
EDIT:
#include <pspkernel.h>
#include <pspdebug.h>
#include <string.h>
#include <stdio.h>
#include "danzeff.h"
What am I doing wrong? :sC:\pspdev\projects\GPOS>make
psp-gcc -I. -IC:/pspdev/psp/sdk/include -O2 -G0 -Wall -L. -LC:/pspdev/psp/sdk/l
ib danzeff.o main.o -lstdc++ -lpsprtc -lpspwlan -lpspgum -lpspgu -lpspaudio -l
m -lpsppower -o hello.elf
/cygdrive/c/pspdev/bin/../lib/gcc/psp/4.0.2/../../../../psp/lib/crt0.o: In funct
ion `_main':
/home/loser/newtoolchain/pspsdk/src/startup/crt0.c:68: undefined reference to `s
trlen'
/home/loser/newtoolchain/pspsdk/src/startup/crt0.c:83: undefined reference to `a
texit'
/home/loser/newtoolchain/pspsdk/src/startup/crt0.c:89: undefined reference to `e
xit'
/cygdrive/c/pspdev/bin/../lib/gcc/psp/4.0.2/../../../../psp/lib/crt0.o: In funct
ion `_start':
/home/loser/newtoolchain/pspsdk/src/startup/crt0.c:149: undefined reference to `
sceKernelCreateThread'
/home/loser/newtoolchain/pspsdk/src/startup/crt0.c:150: undefined reference to `
sceKernelStartThread'
main.o: In function `exit_callback':
main.c:(.text+0x8): undefined reference to `sceKernelExitGame'
main.o: In function `CallbackThread':
main.c:(.text+0x38): undefined reference to `sceKernelCreateCallback'
main.c:(.text+0x40): undefined reference to `sceKernelRegisterExitCallback'
main.c:(.text+0x48): undefined reference to `sceKernelSleepThreadCB'
main.o: In function `SetupCallbacks':
main.c:(.text+0x88): undefined reference to `sceKernelCreateThread'
main.c:(.text+0xa4): undefined reference to `sceKernelStartThread'
main.o: In function `substr':
main.c:(.text+0xc8): undefined reference to `strncat'
main.o: In function `main':
main.c:(.text+0xe4): undefined reference to `pspDebugScreenInit'
main.c:(.text+0xf4): undefined reference to `danzeff_load'
main.c:(.text+0x134): undefined reference to `pspDebugScreenPrintf'
main.c:(.text+0x140): undefined reference to `sceKernelDelayThread'
main.c:(.text+0x150): undefined reference to `sceKernelSleepThread'
main.c:(.text+0x178): undefined reference to `danzeff_render'
collect2: ld returned 1 exit status
make: *** [hello.elf] Error 1
EDIT:
#include <pspkernel.h>
#include <pspdebug.h>
#include <string.h>
#include <stdio.h>
#include "danzeff.h"
Okay, the LIBDIR line was in B2 only because B2 used a library from D_A's SDK. If you are using D_A's SDK, you don't need to specify that. Also, your LIBS = line is a bit slim... what happened to all the other libs you specified in the post previously? If it's C++, you need to specify stdc++ at least. Also, moves the LIBS ad LIBDIR lines above the EXTRA_TARGETS line. I'm not sure the position makes a difference, but I'm not sure it works if it's after the include line since then neither are defined when the included file is included.
Thanks alot J.F, I'm close now.
New makefile:
Any suggestions?
New makefile:
New console output:TARGET = GPOS
OBJS = danzeff.o main.o
LIBS = -lstdc++ -lpsprtc -lpspwlan -lpspgum -lpspgu -lpspaudio -lm -lpsppower
LIBDIR = $(PSPDEV)/SDK/lib
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = GPOS
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
And yes, I did included the danzeff.h file at the start of main.c.C:\pspdev\projects\GPOS>make
psp-gcc -I. -IC:/pspdev/psp/sdk/include -O2 -G0 -Wall -LC:/pspdev/SDK/lib -L. -
LC:/pspdev/psp/sdk/lib danzeff.o main.o -lstdc++ -lpsprtc -lpspwlan -lpspgum -
lpspgu -lpspaudio -lm -lpsppower -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpsp
sdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lp
spuser -lpspkernel -o GPOS.elf
main.o: In function `main':
main.c:(.text+0xf4): undefined reference to `danzeff_load'
main.c:(.text+0x178): undefined reference to `danzeff_render'
collect2: ld returned 1 exit status
make: *** [GPOS.elf] Error 1
Any suggestions?
Nah, that isn't the problem.
Code: Select all
int main()
{
pspDebugScreenInit();
SetupCallbacks();
danzeff_load();
if(danzeff_isinitialized())
{
danzeff_render();
}
// Other stuff here
sceKernelSleepThread();
return 0;
}
Make sure your danzeff.h has this in it near the top
I know I've had to add that to other PSP includes, I just don't remember if danzeff.h had that originally.
Code: Select all
#ifdef __cplusplus
extern "C" {
#endif
Sorry for the late reply, but I was busy with school and such stuff.
Anyway, latest makefile:
Anyway, latest makefile:
Full output of the compiler:TARGET = GPOS
OBJS = main.o danzeff.o
LIBS = -lstdc++ -lpsprtc -lpspwlan -lpspgum -lpspgu -lpspaudio -lm -lpsppower
LIBDIR = $(PSPDEV)/SDK/lib
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = GPOS
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
(:C:\pspdev\projects\GPOS>make
psp-gcc -I. -IC:/pspdev/psp/sdk/include -O2 -G0 -Wall -LC:/pspdev/SDK/lib -L. -
LC:/pspdev/psp/sdk/lib main.o danzeff.o -lstdc++ -lpsprtc -lpspwlan -lpspgum -
lpspgu -lpspaudio -lm -lpsppower -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpsp
sdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lp
spuser -lpspkernel -o GPOS.elf
main.o: In function `main':
main.c:(.text+0xf4): undefined reference to `danzeff_load'
main.c:(.text+0x178): undefined reference to `danzeff_render'
collect2: ld returned 1 exit status
make: *** [GPOS.elf] Error 1
What firmware are you building for anyway?
Maybe adding these lines to your makefile could help...
Maybe adding these lines to your makefile could help...
Code: Select all
BUILD_PRX = 1
PSP_FW_VERSION = xxx (enter yours)
...sorry for my english...
You NEED danzeff to be C code. It needs to be .c and compiled by gcc, or it needs the extern "C" {} and be compiled by g++. If you don't understand C++ name mangling (which is almost certainly the problem here), then you should post more of the code so we can see where it's wrong. As it is, we're guessing based of a couple error lines and your assertions that you're doing it right.Producted wrote:^
I don't exactly get where you are pointing at. If you are talking about those extern lines, danzeff.h was already containing them by default. And I didn't changed the extension .c to .cpp.
I'll try that but I don't think it's going to work...
EDIT: Nope :(
Look at how it's used in Basilisk II - look at how the filenames are done, look at what is enclosed in extern "C" {}, look at how it's compiled.
-
- Posts: 91
- Joined: Sun Feb 22, 2009 8:32 am
- Location: Melbourne Australia ZOMG
I do have all the correct extensions, danzeff.c is containing these lines:
I tried the thing which kralyk said, with no result (I don't see why it would work anyway, BUILD_PRX means that I'm working on a PRX which I'm not (right?))
Slasher could you explain what "defining a prototype for the functions" means?
What did I forgot?
The filenames in Basilisk II\src\PSP\Danzeff are the same as the extensions of my danzeff files. My makefile is almost the same as Basillisk's makefile (except from the stuff I won't need).#ifndef INCLUDED_KEYBOARDS_DANZEFF_H
#define INCLUDED_KEYBOARDS_DANZEFF_H
//danzeff is BSD licensed, if you do make a new renderer then please share it back and I can add it
//to the original distribution.
//Set which renderer target to build for
/* #define DANZEFF_SDL */
/* #define DANZEFF_SCEGU */
//the SDL implementation needs the pspctrl_emu wrapper to convert
//a SDL_Joystick into a SceCtrlData
#ifdef DANZEFF_SDL
#include "pspctrl_emu.h"
#else //not DANZEFF_SDL
#include <pspctrl.h>
#endif //DANZEFF_SDL
#ifdef __cplusplus
extern "C" {
#endif
[..]
#ifdef __cplusplus
}
#endif
#endif //INCLUDED_KEYBOARDS_DANZEFF_H
I tried the thing which kralyk said, with no result (I don't see why it would work anyway, BUILD_PRX means that I'm working on a PRX which I'm not (right?))
Slasher could you explain what "defining a prototype for the functions" means?
What did I forgot?