Setting up Dev-C++ with PSPSDK
Setting up Dev-C++ with PSPSDK
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/
Here is the link: http://www.cs.purdue.edu/homes/ljbuesch/
Lego of my Ago!
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
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 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!
Tutorial problems
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:
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.
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:
The current one I am using inside of Dev-C++ 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
Ok, there are a number of changes, but only some would pertain to you guys, the rest are specific to my program.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
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.
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.
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!
-
- Posts: 9
- Joined: Tue Jul 05, 2005 12:06 pm
- Location: UK
- Contact:
The issues should be sorted with the latest release, give it a blast & let me know of there are any problems with r3Agoln 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.
-
- Posts: 8
- Joined: Tue Jul 12, 2005 6:05 pm
-
- Posts: 8
- Joined: Tue Jul 12, 2005 6:05 pm
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
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
-HB
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!
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!
-
- Posts: 8
- Joined: Tue Jul 12, 2005 6:05 pm
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 =/
-HB[/code]
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
-
- Posts: 8
- Joined: Tue Jul 12, 2005 6:05 pm
-
- Posts: 8
- Joined: Tue Jul 12, 2005 6:05 pm
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)
-HB (still messing with it)
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
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!
-
- Posts: 8
- Joined: Tue Jul 12, 2005 6:05 pm
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
thanks.[/code]
Code: Select all
C:\Dev-Cpp\project\Makefile [Build Error] No rule to make target `main.o', needed by `project.elf'. Stop.
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
What does the makefile look like?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
Lego of my Ago!
Here is the make file: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?
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
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
-
- Posts: 9
- Joined: Tue Jul 05, 2005 12:06 pm
- Location: UK
- Contact:
Move your toolchain to a path without spaces. That can cause serious problems with gnu tools.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