Win32 native Toolchain for PSPSDK

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

Moderators: cheriff, TyRaNiD

Post Reply
ne0h
Posts: 386
Joined: Thu Feb 21, 2008 2:15 am

Post by ne0h »

I'm using NetBeans 6.1 too, it was wonderful, the only little problem was create a new project, you must edit the xml file to give the new makefile...
But it's very simple!
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

Could you please tell us how to setup netbeans for the SDK? I remembered to try a long time ago but code complete didn't work and i had troubles because the gcc executable is called psp-gcc and not gcc.

Thanks
KickinAezz
Posts: 328
Joined: Sun Jun 03, 2007 10:05 pm

Post by KickinAezz »

0.8.2 Works perfectly.

-

Thanks.
Intrigued by PSP system Since December 2006.
Use it more for Development than for Gaming.
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

I've rebuild the SDK with the same fixes mingw used for windows Vista and tried to build again the simple net sample and it works as i showed yesterday.

Today i used my experimental build on my girlfriends laptop (windows Vista home) and it worked fine.

This laptop has no dev tools or compilers so it was totally clean. One thing the mingw people say about vista is that for some weird reason (the access() function to be precise) the compiler must be in the same partition as the sources you want to compile.

So according to this if you install in C:\pspsdk then your sources must be somewhere on the C: drive.

Another thing is that on Vista it is not recommended to install inside your home folder again because of the access rights and stuff.

My connection from here is slow so tomorrow morning i'll upload the vista experimental builds (full SDK + no docs SDK) to the experimental builds under the tag "0.8.2 vista".

If still is won't work for you, please post some small c code + makefile that reproduces the failure. Please note that i'll run the script from the command line because if i start installing visual studio + eclipse + netbeans + etc... on my girlfriends laptop she'll kick my butt :) for filling the computer with junk :)
KickinAezz wrote:I'm just installed 0.7.4 and I'm NOT able to compile :O

Code: Select all

psp-gcc -I. -ID:/PSPSDK/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION=150   -c -o main.o main.c
In file included from D:/PSPSDK/psp/sdk/include/pspuser.h:26,
                 from D:/PSPSDK/psp/sdk/include/pspkernel.h:18,
                 from main.c:1:
D:/PSPSDK/psp/sdk/include/psputils.h:32:22: error: sys/time.h: No such file or directory
In file included from D:/PSPSDK/psp/sdk/include/pspuser.h:26,
                 from D:/PSPSDK/psp/sdk/include/pspkernel.h:18,
                 from main.c:1:
D:/PSPSDK/psp/sdk/include/psputils.h:38: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'sceKernelLibcTime'
D:/PSPSDK/psp/sdk/include/psputils.h:43: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'sceKernelLibcClock'
D:/PSPSDK/psp/sdk/include/psputils.h:48: warning: 'struct timezone' declared inside parameter list
D:/PSPSDK/psp/sdk/include/psputils.h:48: warning: its scope is only this definition or declaration, which is probably not what you want
D:/PSPSDK/psp/sdk/include/psputils.h:48: warning: 'struct timeval' declared inside parameter list
main.c:4:19: error: stdio.h: No such file or directory
main.c:5:20: error: stdlib.h: No such file or directory
main.c:6:20: error: string.h: No such file or directory
main.c:7:20: error: unistd.h: No such file or directory
In file included from main.c:11:
D:/PSPSDK/psp/sdk/include/pspnet_resolver.h:22:24: error: netinet/in.h: No such file or directory
In file included from main.c:11:
D:/PSPSDK/psp/sdk/include/pspnet_resolver.h:62: warning: 'struct in_addr' declared inside parameter list
D:/PSPSDK/psp/sdk/include/pspnet_resolver.h:76: warning: 'struct in_addr' declared inside parameter list
main.c:14:23: error: arpa/inet.h: No such file or directory
main.c:15:24: error: sys/select.h: No such file or directory
main.c:16:19: error: errno.h: No such file or directory
main.c:17:24: error: sys/socket.h: No such file or directory
main.c: In function 'connect_to_apctl':
main.c:37: warning: implicit declaration of function 'printf'
main.c:37: warning: incompatible implicit declaration of built-in function 'printf'
main.c:41: warning: incompatible implicit declaration of built-in function 'printf'
main.c: At top level:
main.c:72: warning: 'struct sockaddr_in' declared inside parameter list
main.c: In function 'initSocket':
main.c:74: error: dereferencing pointer to incomplete type
main.c:74: error: 'AF_INET' undeclared (first use in this function)
main.c:74: error: (Each undeclared identifier is reported only once
main.c:74: error: for each function it appears in.)
main.c:75: error: dereferencing pointer to incomplete type
main.c:75: warning: implicit declaration of function 'inet_addr'
main.c:76: error: dereferencing pointer to incomplete type
main.c:76: warning: implicit declaration of function 'htons'
main.c: In function 'connect_to':
main.c:82: error: storage size of 'name' isn't known
main.c:86: warning: implicit declaration of function 'socket'
main.c:86: error: 'PF_INET' undeclared (first use in this function)
main.c:86: error: 'SOCK_STREAM' undeclared (first use in this function)
main.c:86: error: 'IPPROTO_TCP' undeclared (first use in this function)
main.c:101: warning: implicit declaration of function 'connect'
main.c:104: warning: implicit declaration of function 'close'
main.c:84: warning: unused variable 'flag'
main.c:82: warning: unused variable 'name'
main.c: In function 'main':
main.c:136: warning: implicit declaration of function 'strcpy'
main.c:136: warning: incompatible implicit declaration of built-in function 'strcpy'
make.exe: *** [main.o] Error 1
Process terminated with status 2 (0 minutes, 3 seconds)
22 errors, 18 warnings
Could you kindly post a fix soon. Thanks!
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

Ok i was slow to reply :) but anyway now it is more tested and i support Vista too :)

The new fixes just add some compile extra flags to GCC, however before they were being used only on the second step of GCC build, now they are on both steps which should make it even more stable.
ne0h
Posts: 386
Joined: Thu Feb 21, 2008 2:15 am

Post by ne0h »

Thanks Heimdall for your work! You're the best!
Bristrolax
Posts: 1
Joined: Thu May 15, 2008 3:27 am
Contact:

doubt :)

Post by Bristrolax »

Hi!!, im currently using your pspsdk here at work.

first of all let me thank you for making our life easier xD

at home i use cygwin but here i cannot connect to any svn and besides i work with eclipse so this became really really really usefull!!


my question is, i need to use some extra libs that dont come bundled with the sdk, so i downloaded de libpng-1.2.8-pspdevpak.exe from your box.net

do i just install it from anywhere? or do i have to be at certain folder and will it just work or do i have to do any extra "moving files somewhere" or something?


thanks!! ^__^


EDIT:

It worked :) .!
I Know The Pieces Fit.
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

glad to hear, but update your links to http://sourceforge.net/projects/minpspw this site contains all the devpaks + latest SDK and the sources under SVN and browsable through the site.
ne0h
Posts: 386
Joined: Thu Feb 21, 2008 2:15 am

Post by ne0h »

Heidall, for NetBeans i've simply renamed the file! psp-gcc.exe ->> gcc.exe..
ane modify the build.mak and it works great!
The only problem is the makefile!
With NetBeans a part of makefile is autogenerated and i'ven't found a option to disable the function!
So you have to edit the .xml files in the Projects dir and put the correct name of the makefile or rename the makefile as the original!
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

The makefile problem i algo got it with eclipse, the good thing with eclipse is that they have this special project type "Makefile project" that the IDE doesn't generate any makefile for you and expects you to provide one. Isn't there anything like that with netbeans?

so you just renamed:
psp-gcc to gcc
psp-g++ to g++
psp-gdb to gdb

any other file?

Maybe I could add a extra check box in the installer if you want netbeans support and do this renaming during the installer, would it work? what do you think?
ne0h
Posts: 386
Joined: Thu Feb 21, 2008 2:15 am

Post by ne0h »

Yes, good idea, but is very simple to do that manually, add this funct only if is simple for you!
However i'm not sure but i think that i've renamed only this tree files and now NetBeans works great!
Heimdall, very good work for all! (I think it's not a very good english, excuse me.. :( )
bullcrap0
Posts: 3
Joined: Thu Apr 17, 2008 10:32 am

Post by bullcrap0 »

Heimdall wrote: so you just renamed:
psp-gcc to gcc
psp-g++ to g++
psp-gdb to gdb
[...]
Maybe I could add a extra check box in the installer if you want netbeans support and do this renaming during the installer, would it work? what do you think?
Wouldn't that interfere with another cygwin installation? Also, please have the installer check if pspsdk's path is already in the user's PATH variable. I just noticed I have it three times in there.

Other than that, great job and thanks for this great tool! Keep up the good work!
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

Yes this solution will interfere with other gcc installations on the path but the idea was only to install it if the user selects it, otherwise you'll get the usual psp-* tools.

My idea is to write a simple wrapper instead of duplicating the binary all over, since each compiler is a few hundreds of kilobytes.

About the other PATH issue, i'm aware of it once you install over and over the sdk you get it duplicated. Since 0.8.2 I try to remove it from the path before the installation process but it seams that my nsis scripting skills are not that good :-)

If anyone had a nsis script for it it would be great.
User avatar
jean
Posts: 489
Joined: Sat Jan 05, 2008 2:44 am

Post by jean »

NetBeans i've simply renamed the file! psp-gcc.exe ->> gcc.exe
don't really remember what i messed, but i'm sure i did not renamed anything. Apart from the fact that you can specify alternative command names somewhere in config tabs, you can just set up a project telling netBeans to use makefiles....make is always make. For what concerns debugging, i never did it with GDB but with some SIO printouts placed in strategic places ;P so i cannot tell....
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

In that case i'd rather keep the SDK as is, because it would remain exactly the same if you use it on windows, cygwin, linux or mac.

One think is to add simple utilities to the SDK to make it more productive (what i think i've been doing) and another is to change the toolchain and then be stuck with maintenance of that change when there are simple ways to tweak the IDE to use other toolchains than the default GNU for your host machine.
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

Guys, i've been playing around with my shell scripts and I think i can also generate installers based on shell scripts for the devpaks which could let you install the devpaks on cygwin and even maybe on linux machines. I'll not build sdks for cygwin or linux only devpaks since i can build the on msys and they should work also on those systems.

What do you guys think, would this be usefull? if yes i'll start slowly building these new packages
RobAmacAF
Posts: 2
Joined: Sat Jun 07, 2008 9:37 pm

Problem installing MSys

Post by RobAmacAF »

When I download that mSys installer and try to install it, it copies alot of files then opens a cmd window and trys to run a .sh, I am getting this error:


C:\msys\postinstall>PATH ..\bin;C:\Program Files\Internet Explorer;;C:\Windows\s
ystem32;C:\Windows;C:\Windows\System32\Wbem;C:\PROGRA~1\COMMON~1\ULEADS~1\MPEG;C
:\Program Files\QuickTime\QTSystem\;C:\Program Files\Microsoft SQL Server\90\Too
ls\binn\;C:/pspdev1/bin;C:\pspsdk\bin;C:\msys\bin;e:\pspsdk\bin

C:\msys\postinstall>..\bin\sh.exe pi.sh
AllocationBase 0x0, BaseAddress 0x715B0000, RegionSize 0x1D0000, State 0x10000
C:\msys\bin\sh.exe: *** Couldn't reserve space for cygwin's heap, Win32 error 0

C:\msys\postinstall>pause
Press any key to continue . . .
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

msys installer? what do you mean my builds do not require msys or cygwin, they are for windows CLI? can you detail more your problem?
RobAmacAF
Posts: 2
Joined: Sat Jun 07, 2008 9:37 pm

Post by RobAmacAF »

Heimdall wrote:msys installer? what do you mean my builds do not require msys or cygwin, they are for windows CLI? can you detail more your problem?
I went to the sourceforge post that is in the first post of this thread. I downloaded the VISTA file, (the pspsdk 0.8.2 Vista release)

Installed that to c:\pspsdk

Read the readme file in it, it says:
1) Set up your environment by installing the following software:

Option A)
* Follow the Install wizard:
MSYS-1.0.11-2004.04.30-1.exe

I downloaded that file, and try to install it and it doesn't work
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

if you installed the sdk you're ready to code. those instructions are to build the sdk yourself
egorive
Posts: 24
Joined: Thu Jun 22, 2006 11:50 pm

problem

Post by egorive »

Hi, I have the same problem as nbollom but cant fix it. I have try in msDos window and the make command works but in eclipse I take this:

**** Build of configuration Default for project Hello World ****

(Exec error:El sistema no puede hallar el archivo especificado.
)

Translated: (the system can't find the specified file).

This is the makefile:

TARGET = template
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 = Template

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



and this is the main.c:


#include <pspkernel.h>
#include <pspdebug.h>

#define printf pspDebugScreenPrintf

/* Define the module info section */
PSP_MODULE_INFO("template", 0, 1, 1);

/* Define the main thread's attribute value (optional) */
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);

int main(int argc, char *argv[])
{
pspDebugScreenInit();

pspDebugScreenPrintf("Hello World\n");

return 0;
}


Compearing both image and example image I don't have includes header files above main.c (in left side Proyect Explorer).

Thanks a lot for helping me, and sorry for my English!
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

Sometimes eclipse just keeps in memory only the last discovered include directories. If there is a problem during this discovery then you have to configure then by hand or re-create the project.

To do this make sure your eclipse is using psp-gcc by default instead of gcc, then check the same in the project and edit the include paths for:

c:/pspsdk/include
c:/pspsdk/psp/include
c:/pspsdk/psp/sdk/include

this should had all the include files available to your project
Bicubic
Posts: 6
Joined: Wed Jun 11, 2008 5:30 am

Post by Bicubic »

Thank you very much for creating and maintaining this.
I had a lot of trouble building the toolchain in linux/cygwin and neither option was terribly attractive anyway. This is great.
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

Thanks for your feedback, another announcement for a test release now with:

* GCC 4.3.1 (just released last week)
* Synch SDK with SVN
* uint32_t/int32_t are aliased to unsigned int/int reducing lots of compilation warnings.

get it here:
https://sourceforge.net/project/showfil ... _id=273347

As usual there are 2 packages, one only the SDK and other including documentation.
KickinAezz
Posts: 328
Joined: Sun Jun 03, 2007 10:05 pm

Post by KickinAezz »

Heimdall wrote:Thanks for your feedback, another announcement for a test release now with:

* GCC 4.3.1 (just released last week)
* Synch SDK with SVN
* uint32_t/int32_t are aliased to unsigned int/int reducing lots of compilation warnings.

get it here:
https://sourceforge.net/project/showfil ... _id=273347

As usual there are 2 packages, one only the SDK and other including documentation.
Will this work with Vista or should I use 0.8.2-Vista release?
Intrigued by PSP system Since December 2006.
Use it more for Development than for Gaming.
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

it works on vista. since that experimental build all new builds have the vista patch. however you should not install the sdk inside your profile folder because some people say it does not work. but that is a known mingw problem.
Moonshine
Posts: 1
Joined: Mon Jun 30, 2008 12:40 pm

Post by Moonshine »

Hello,

Thank you very much Heimdall! Awesome works!
I'm a newbie to PSP programming, so may you tell me how do debug via PSPlinkUSB using your SDK ? I'm using Visual Studio.

Best regards,
User avatar
Wally
Posts: 663
Joined: Mon Sep 26, 2005 11:25 am

Post by Wally »

Moonshine wrote:Hello,

Thank you very much Heimdall! Awesome works!
I'm a newbie to PSP programming, so may you tell me how do debug via PSPlinkUSB using your SDK ? I'm using Visual Studio.

Best regards,
Read the manual that comes with it :P

P.S Might be wise to change your nick to prevent confusion.. moonlight is a respected dev here :)
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

Just updated the SDK to the latest SVN. Get it from the usual place:

http://downloads.sourceforge.net/minpsp ... -0.8.4.exe
http://downloads.sourceforge.net/minpsp ... -nodoc.exe

Now with GCC 4.3.1
hlide
Posts: 739
Joined: Sun Sep 10, 2006 2:31 am

Post by hlide »

does it contain usbhostfs_pc.exe and pspsh.exe ? I cannot find them

EDIT: never mind, those files happened not be installed properly for some reason. By removing them manually and running a proper installation of minpspsdk, I get everything okay now.
Post Reply