Setting up Dev-C++ with PSPSDK

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

Moderators: cheriff, TyRaNiD

User avatar
Agoln
Posts: 326
Joined: Wed Jun 08, 2005 3:14 am
Location: Fort Wayne, IN

Setting up Dev-C++ with PSPSDK

Post by Agoln »

I have created a simple, yet effective tutorial for those with Dev-C++ that wish to use it to make their PSP games. If there are any errors, please contact me and I will fix them.

Here is the link: http://www.cs.purdue.edu/homes/ljbuesch/
Lego of my Ago!
mrbrown
Site Admin
Posts: 1537
Joined: Sat Jan 17, 2004 11:24 am

Post by mrbrown »

Moved to Development and stickied.
etx
Posts: 33
Joined: Sat Apr 02, 2005 12:54 am
Location: Detroit

Post by etx »

I'd been using eclipse.org until I found out about this IDE. It's great! I recommend everyone check it out.
MindWall
Posts: 70
Joined: Tue May 10, 2005 4:27 pm

Post by MindWall »

does this tutorial work when setting up with the "win32 native (non cygwin) psp toolchain"?
The devkitPro team are proud to announce the addition of a PSP toolchain to our collection. This is based on the patches from http://ps2dev.org/ and includes PSPSDK 1.0+beta. The release will be moved to it's own section pending testing and feedback.

http://devkitpro.sourceforge.net/index.shtml
User avatar
Agoln
Posts: 326
Joined: Wed Jun 08, 2005 3:14 am
Location: Fort Wayne, IN

Post by Agoln »

I had tried using their's, but the problem was, is that I was getting a lot of problems which are discussed here.

The solution to those problems was that they needed to upgrade the toolchain, and when I had used the one discussed in this tutorial, it worked perfectly.

You can try it and see what happens, maybe I had screwed something up.
Lego of my Ago!
HexDump
Posts: 70
Joined: Tue Jun 07, 2005 9:18 pm

Post by HexDump »

I´m having problems with error output format. It is strange, it shows more than 1 line in a error line, and it sometimes do not jump to the source code line that produced the error, has anyone been able to fix this?

Thanks in advance,
HexDump.
MindWall
Posts: 70
Joined: Tue May 10, 2005 4:27 pm

Post by MindWall »

Agoln, I'm trying to use your tutorial and setup the dev--C++, I have a few questions...

shoudn't there be additional directories set in the CompilerOptions>Directories
?

where does the psp-gdb.exe come from?

where does the makefile.bat come from? (any instrucitions how to make it?)
Modab
Posts: 4
Joined: Tue Jun 28, 2005 5:23 am

Tutorial problems

Post by Modab »

Ok, like all of you, I noticed the tutorial has several problems (he said as much in a different post, since he did it over 30 min during his lunch break). At this point I have gotten it all to work for me, so I will try and help a few of your problems, if they were the same as mine.

First off, there is no psp-gdb.exe. he just made it up. Use the default one. The only compiler programs I changed were psp-gcc and psp-g++

I did not add *any* additional directories in the CompilerOptions>Directories area. This is because I am not using the Dev-Cpp automatic make program. Instead (and this part is documented, though partially incorrectly) I went into Project Options>Makefile and checked "Use custom Makefile (do not generate a Makefile, use this one)
And then for my makefile I actually used the makefile I'd had since I started compiling the "sdktest" program, called "Makefile". I never used any "makefile.bat" or whatever.

I did need to make a few changed to my Makefile. The original, unfettered SDK makefile I used is this:
TARGET = sdktest
OBJS = main.o

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

LIBDIR =
LDFLAGS =

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = SDK Test v1.0

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
The current one I am using inside of Dev-C++ is this:
TARGET = bitmapViewer
OBJS = main.o pspBMP.o

INCDIR =
CFLAGS = -O2 -G0 -Wall -I"C:\Program Files\PSPDev\include"
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

LIBDIR =
LDFLAGS =

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Bitmap Viewer v0.1
PSP_EBOOT_ICON = icon.png
PSPSDK= C:/Progra~1/PSPDev/psp/sdk
include $(PSPSDK)/lib/build.mak
Ok, there are a number of changes, but only some would pertain to you guys, the rest are specific to my program.
First change that matters, my CFLAGS now has a -I"C:\Program Files\PSPDev\include" bit to it. I can't tell you where you put yours, but if you just used the defaults when you installed Agoln's link to that setup.exe, it will be there.
The other big change I made was to the PSPSDK variable, since that path was made assuming you were in the cygwin bash environment, and $(shell psp-config --pspsdk-path) would actually give you something. Instead, I just passed it the full location, hard-coded, and I changed "Program Files" to "Progra~1" since the compiler didn't seem to like the spaces in between Program and Files.

That's all I did to get it working. Bear in mind I used the toolchain he suggested I use (the setup.exe he links to), so try that if you haven't before. If I can think of anything else, I will tell you guys.
User avatar
Subzero
Posts: 9
Joined: Mon Jul 11, 2005 3:38 am

Post by Subzero »

Hello
I have tried setting this up and
compiling the sdktest sample. I am getting this error

C:\pspdev\devkitPSP\psp\sdk\samples\sdktest\Makefile [Build Error] No rule to make target `main.o', needed by `sdktest.elf'. Stop.

could someone help with this please.

Thank you
Modab
Posts: 4
Joined: Tue Jun 28, 2005 5:23 am

Post by Modab »

I never came across that error, but it could be a problem in the build.mak file that you are including, or your Makefile

Perhaps you should post your Makefile here?
User avatar
Agoln
Posts: 326
Joined: Wed Jun 08, 2005 3:14 am
Location: Fort Wayne, IN

Post by Agoln »

MMk, I have changed the one picture so that it doesn't have psp-gdb, and I deleted the makefile picture and added some information on what to set that file to.

Modab's information on the make file should give you a good head start, and if you are making your own projects, I would higly suggest you use his makefile as a beginning step.
Lego of my Ago!
WinterMute
Posts: 9
Joined: Tue Jul 05, 2005 12:06 pm
Location: UK
Contact:

Post by WinterMute »

Agoln wrote:I had tried using their's, but the problem was, is that I was getting a lot of problems which are discussed here.

The solution to those problems was that they needed to upgrade the toolchain, and when I had used the one discussed in this tutorial, it worked perfectly.

You can try it and see what happens, maybe I had screwed something up.
The issues should be sorted with the latest release, give it a blast & let me know of there are any problems with r3
Hybrid Blue
Posts: 8
Joined: Tue Jul 12, 2005 6:05 pm

Post by Hybrid Blue »

I havnt been able to get this to work? would someone please help me out some? for some reasion im getting a LOT of errors when just trying to compile the sample program..
Thanks,

-HB
User avatar
Agoln
Posts: 326
Joined: Wed Jun 08, 2005 3:14 am
Location: Fort Wayne, IN

Post by Agoln »

Hybrid Blue wrote:I havnt been able to get this to work? would someone please help me out some? for some reasion im getting a LOT of errors when just trying to compile the sample program..
Thanks,

-HB
Please post the errors.
Lego of my Ago!
Hybrid Blue
Posts: 8
Joined: Tue Jul 12, 2005 6:05 pm

Post by Hybrid Blue »

Code: Select all

Compiler: PSPtest
Building Makefile: "C:\Dev-Cpp\Makefile.win"
Executing  make...
make.exe -f "C:\Dev-Cpp\Makefile.win" all
psp-g++.exe -c ../PSPsdk/psp/sdk/samples/sdktest/main.c -o ../PSPsdk/psp/sdk/samples/sdktest/main.o   

../PSPsdk/psp/sdk/samples/sdktest/main.c:14:23: error: pspkernel.h: No such file or directory
../PSPsdk/psp/sdk/samples/sdktest/main.c:15:22: error: pspdebug.h: No such file or directory
../PSPsdk/psp/sdk/samples/sdktest/main.c:20: error: expected constructor, destructor, or type conversion before '(' token
../PSPsdk/psp/sdk/samples/sdktest/main.c:23: error: expected constructor, destructor, or type conversion before '(' token
../PSPsdk/psp/sdk/samples/sdktest/main.c: In function 'int exit_callback()':
../PSPsdk/psp/sdk/samples/sdktest/main.c:33: error: 'sceKernelExitGame' was not declared in this scope
../PSPsdk/psp/sdk/samples/sdktest/main.c: In function 'void CallbackThread(void*)':
../PSPsdk/psp/sdk/samples/sdktest/main.c:43: error: 'pspDebugScreenPrintf' was not declared in this scope
../PSPsdk/psp/sdk/samples/sdktest/main.c:45: error: 'sceKernelCreateCallback' was not declared in this scope
../PSPsdk/psp/sdk/samples/sdktest/main.c:46: error: 'sceKernelRegisterExitCallback' was not declared in this scope
../PSPsdk/psp/sdk/samples/sdktest/main.c:48: error: 'sceKernelSleepThreadCB' was not declared in this scope
../PSPsdk/psp/sdk/samples/sdktest/main.c: In function 'void dump_threadstatus()':
../PSPsdk/psp/sdk/samples/sdktest/main.c:55: error: 'ThreadStatus' was not declared in this scope
../PSPsdk/psp/sdk/samples/sdktest/main.c:55: error: expected `;' before 'status'
../PSPsdk/psp/sdk/samples/sdktest/main.c:58: error: 'sceKernelGetThreadId' was not declared in this scope
../PSPsdk/psp/sdk/samples/sdktest/main.c:59: error: 'status' was not declared in this scope
../PSPsdk/psp/sdk/samples/sdktest/main.c:60: error: 'pspDebugScreenPrintf' was not declared in this scope
../PSPsdk/psp/sdk/samples/sdktest/main.c:62: error: 'sceKernelReferThreadStatus' was not declared in this scope
../PSPsdk/psp/sdk/samples/sdktest/main.c: In function 'int SetupCallbacks()':
../PSPsdk/psp/sdk/samples/sdktest/main.c:81: error: 'sceKernelCreateThread' was not declared in this scope
../PSPsdk/psp/sdk/samples/sdktest/main.c:84: error: 'sceKernelStartThread' was not declared in this scope
../PSPsdk/psp/sdk/samples/sdktest/main.c: In function 'int main()':
../PSPsdk/psp/sdk/samples/sdktest/main.c:92: error: 'pspDebugScreenInit' was not declared in this scope
../PSPsdk/psp/sdk/samples/sdktest/main.c:93: error: 'g_elf_name' was not declared in this scope
../PSPsdk/psp/sdk/samples/sdktest/main.c:93: error: 'pspDebugScreenPrintf' was not declared in this scope
../PSPsdk/psp/sdk/samples/sdktest/main.c:97: error: 'sceKernelSleepThread' was not declared in this scope
make.exe: *** [../PSPsdk/psp/sdk/samples/sdktest/main.o] Error 1

Execution terminated
This is my makefile

Code: Select all

TARGET = sdktest
OBJS = main.o

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

LIBDIR =
LDFLAGS =

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = SDK Test v1.0

PSPSDK= C:/PSPsdk/psp/sdk
include $(PSPSDK)/lib/build.mak
Thanks!

-HB
Mangus
Posts: 33
Joined: Fri Jun 17, 2005 4:33 pm

Post by Mangus »

no that is not your makefile, your makefile when compiling is the being generated by Dev-C++, make a new project and go to Project options use your PSPSDK compiler, and go to the makefile tab and select the makefile in the C:\PSPsdk\psp\sdk\samples\sdktest and that should work if not, go to project options agian and enter every li and include folder under the C:\pspsdk according to what the folder is called. C:\PSPsdk\lib and all of its contents belong on the lib tab of directories under progect options, do this with the others and be sure to add the folders under C:\PSPsdk\psp and C:\PSPsdk\psp\sdk.

edit: almost forget just add main.c to the project or make a new file in project and copy/paste the code from main.c of sdktest to this new file and save it.

Good Luck Deving!
Hybrid Blue
Posts: 8
Joined: Tue Jul 12, 2005 6:05 pm

Post by Hybrid Blue »

ok... so i made those few changes and added every dir for the LIB and INCLUDES that i could find in the psp sdk..ok......well now its not making the other errors but now i get these errors? Could this be a problem with the program i am useing for Make? please tell me what you all are useing for your make program and where it may be installed? Sry that i sound like such a noob at this...i do dislike windows rather much =/

Code: Select all

Compiler: psp
Building Makefile: "C:\Dev-Cpp\Makefile.win"
Executing  make...
make.exe -f "C:\Dev-Cpp\Makefile.win" all
psp-gcc.exe -c ../PSPsdk/psp/sdk/samples/sdktest/main.c -o ../PSPsdk/psp/sdk/samples/sdktest/main.o -I"C:/PSPsdk/psp/include"  -I"C:/PSPsdk/psp/sdk/include"  -I"C:/PSPsdk/include"   

psp-gcc.exe ../PSPsdk/psp/sdk/samples/sdktest/main.o  -o "Project1.exe" -L"C:/PSPsdk/lib/gcc/psp/4.0.0" -L"C:/PSPsdk/psp/lib" -L"C:/PSPsdk/libexec" -L"C:/PSPsdk/psp/sdk/lib"  

/cygdrive/c/PSPsdk/bin/../lib/gcc/psp/4.0.0/../../../../psp/lib/crt0.o:/home/dev/pspsdk-1.0+beta/sdk/startup/crt0.S:63: undefined reference to `sceKernelCreateThread'
/cygdrive/c/PSPsdk/bin/../lib/gcc/psp/4.0.0/../../../../psp/lib/crt0.o:/home/dev/pspsdk-1.0+beta/sdk/startup/crt0.S:68: undefined reference to `sceKernelStartThread'
../PSPsdk/psp/sdk/samples/sdktest/main.o: In function `exit_callback':
main.c:(.text+0x10): undefined reference to `sceKernelExitGame'
../PSPsdk/psp/sdk/samples/sdktest/main.o: In function `CallbackThread':
main.c:(.text+0x50): undefined reference to `pspDebugScreenPrintf'
main.c:(.text+0x74): undefined reference to `sceKernelCreateCallback'
main.c:(.text+0x84): undefined reference to `sceKernelRegisterExitCallback'
main.c:(.text+0x8c): undefined reference to `sceKernelSleepThreadCB'
../PSPsdk/psp/sdk/samples/sdktest/main.o: In function `dump_threadstatus':
main.c:(.text+0xbc): undefined reference to `sceKernelGetThreadId'
main.c:(.text+0xd8): undefined reference to `memset'
main.c:(.text+0xec): undefined reference to `pspDebugScreenPrintf'
main.c:(.text+0x108): undefined reference to `sceKernelReferThreadStatus'
main.c:(.text+0x120): undefined reference to `pspDebugScreenPrintf'
main.c:(.text+0x148): undefined reference to `pspDebugScreenPrintf'
main.c:(.text+0x160): undefined reference to `pspDebugScreenPrintf'
main.c:(.text+0x178): undefined reference to `pspDebugScreenPrintf'
main.c:(.text+0x190): undefined reference to `pspDebugScreenPrintf'
../PSPsdk/psp/sdk/samples/sdktest/main.o:main.c:(.text+0x1a8): more undefined references to `pspDebugScreenPrintf' follow
../PSPsdk/psp/sdk/samples/sdktest/main.o: In function `SetupCallbacks':
main.c:(.text+0x22c): undefined reference to `sceKernelCreateThread'
main.c:(.text+0x250): undefined reference to `sceKernelStartThread'
../PSPsdk/psp/sdk/samples/sdktest/main.o: In function `main':
main.c:(.text+0x284): undefined reference to `pspDebugScreenInit'
main.c:(.text+0x28c): relocation truncated to fit: R_MIPS_GPREL16 against `g_elf_name'
main.c:(.text+0x29c): undefined reference to `pspDebugScreenPrintf'
main.c:(.text+0x2b4): undefined reference to `pspDebugScreenPrintf'
main.c:(.text+0x2c4): undefined reference to `sceKernelSleepThread'
collect2: ld returned 1 exit status
make.exe: *** [Project1.exe] Error 1

Execution terminated


-HB[/code]
User avatar
Agoln
Posts: 326
Joined: Wed Jun 08, 2005 3:14 am
Location: Fort Wayne, IN

Post by Agoln »

For some reason it's not linking the correct libraries.

It needs to link -lpspdebug -lpsplibc -lpspkernel (i'm not sure about the order of debug and libc, but kernel has to go last).
Lego of my Ago!
Hybrid Blue
Posts: 8
Joined: Tue Jul 12, 2005 6:05 pm

Post by Hybrid Blue »

ok.. so im not sure how i fix this then? Thanks for all of the help btw

-HB
User avatar
Agoln
Posts: 326
Joined: Wed Jun 08, 2005 3:14 am
Location: Fort Wayne, IN

Post by Agoln »

right-click your project, go to properties.

Go to the makefile tab.

Make sure that the "use custom makefile" is checked, and that you point it to the makefile that is in the sdktest main's makefile.

If it is, and you are still getting these errors, checkout the latest SDK from svn.
Lego of my Ago!
Hybrid Blue
Posts: 8
Joined: Tue Jul 12, 2005 6:05 pm

Post by Hybrid Blue »

ahh alright, well i know that i have the sdk from the link in the tutorial, though im not sure what to do to get the svn latest... maybe ive installed something incorrectly or i need to install something still? is there a list of software/files i should have to be able to do all of this? Ive made use its useing the makefile that same with the install... that has no different effect. Well... other than that im not so sure how to get things working then? maybe there is a tutorial that explains every single step of the process? Thanks for all of your help!

-HB (still messing with it)
User avatar
Agoln
Posts: 326
Joined: Wed Jun 08, 2005 3:14 am
Location: Fort Wayne, IN

Post by Agoln »

well, this will help out a little...

get subversion with cygwin (if it supports it). If not, then get the win32 HERE

Use that to get the latest... the repository is svn://svn.pspdev.org/psp/trunk/psptoolchain
and
svn://svn.pspdev.org/psp/trunk/pspsdk
Lego of my Ago!
Hybrid Blue
Posts: 8
Joined: Tue Jul 12, 2005 6:05 pm

Post by Hybrid Blue »

i must just be a moron or something but for the life of my i just cant make this thing work. Guess im going to put it off for the rest of the night, starting to get tired lol.

-HB
sicksand
Posts: 4
Joined: Wed Jul 13, 2005 4:22 pm

Post by sicksand »

i have no problem in setup the environment in dev cpp. but i have encountered error when compiling it. the output of error are.

Code: Select all

 C:\Dev-Cpp\project\Makefile [Build Error]  No rule to make target `main.o', needed by `project.elf'.  Stop. 
details :

my project.dev file is in Dev-Cpp folder, my project file, main.c and Makefile are in a directory named testpower

Code: Select all

-Dev-Cpp
 |_ project1.dev
 |_ testpower
    |_ main.c
    |_ Makefile
 |_devcpp.exe
thanks.[/code]
User avatar
Agoln
Posts: 326
Joined: Wed Jun 08, 2005 3:14 am
Location: Fort Wayne, IN

Post by Agoln »

sicksand wrote:i have no problem in setup the environment in dev cpp. but i have encountered error when compiling it. the output of error are.

details :

my project.dev file is in Dev-Cpp folder, my project file, main.c and Makefile are in a directory named testpower
What does the makefile look like?
Lego of my Ago!
User avatar
Subzero
Posts: 9
Joined: Mon Jul 11, 2005 3:38 am

Post by Subzero »

Modab wrote:I never came across that error, but it could be a problem in the build.mak file that you are including, or your Makefile

Perhaps you should post your Makefile here?
Here is the make file:

TARGET = sdktest
OBJS = main.o

INCDIR =
CFLAGS = -O2 -G0 -Wall -I"C:\pspdev\devkitPSP\psp\include"

CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

LIBDIR =
LDFLAGS =

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = SDK Test v1.0

PSPSDK=C:/pspdev/devkitPSP/psp/sdk
include $(PSPSDK)/lib/build.mak

Thank you
sicksand
Posts: 4
Joined: Wed Jul 13, 2005 4:22 pm

Post by sicksand »

here is my Makefile

Code: Select all

TARGET = project
OBJS = main.o

INCDIR = 
CFLAGS = -O2 -G0 -Wall -I"C:\Program Files\PSPDev\psp\sdk\include\"
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

LIBDIR =
LDFLAGS =

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Test Pertama Oleh Sicksand
PSP_EBOOT_ICON = ICON0.PNG
# PSPSDK=$(shell psp-config --pspsdk-path)
PSPSDK=C:/Progra~1/PSPDev/psp/sdk
include $(PSPSDK)/lib/build.mak
WinterMute
Posts: 9
Joined: Tue Jul 05, 2005 12:06 pm
Location: UK
Contact:

Post by WinterMute »

sicksand wrote:here is my Makefile

Code: Select all

# PSPSDK=$(shell psp-config --pspsdk-path)
PSPSDK=C:/Progra~1/PSPDev/psp/sdk
include $(PSPSDK)/lib/build.mak
Move your toolchain to a path without spaces. That can cause serious problems with gnu tools.
sicksand
Posts: 4
Joined: Wed Jul 13, 2005 4:22 pm

Post by sicksand »

still i having the same error. i have alter and put toolchain to a folder without a space.
User avatar
Subzero
Posts: 9
Joined: Mon Jul 11, 2005 3:38 am

Post by Subzero »

My toolchain folders have no spaces either.
Same error!
Post Reply