Error compiling starsim using Win32 Dev

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
sausage
Posts: 6
Joined: Tue Jan 20, 2004 1:06 pm
Location: Sydney, Australia
Contact:

Error compiling starsim using Win32 Dev

Post by sausage »

I have just installed a fresh version of Win32 dev using the batch file option. I downloaded starsim to try compiling.

I unpacked the starsim demo source and typed:

make

I get the following:
ee-gcc -O2 -EL -pipe -Wall -Wa,-al -fno-common -Wall -mips3 -mcpu=r5900 -ffreestanding -fnonnull-objects -fno-builtin -fshort-double -nostartfiles -mlong64 -mhard-float -mno-abicalls -c -IC:\PS2Dev\ps2lib/common/include -IC:\PS2Dev\ps2lib/ee/include -c main.c -o main.o > main.lst
cc1: unrecognized option `-fnonnull-objects'
/cygdrive/c/PS2Dev/gcc/ee/bin/../lib/gcc-lib/ee/3.2.2/../../../../ee/bin/as: unrecognized option `-mcpu=r5900'
make: *** [main.o] Error 1

I removed both the -fnonnull-objects and -mcpu=r5900 options from the Makefile and tried make again:

ee-gcc -O2 -EL -pipe -Wall -Wa,-al -fno-common -Wall -mips3 -ffreestanding -fno-builtin -fshort-double -nostartfiles -mlong64 -mhard-float -mno-abicalls -c -IC:\PS2Dev\ps2lib/common/include -IC:\PS2Dev\ps2lib/ee/include -c main.c -o main.o
> main.lst
In file included from main.c:31:
/cygdrive/c/PS2Dev/gcc/ee/ee/sys-include/stdlib.h:57: parse error before '(' token
In file included from main.c:32:
nprintf.h:3: conflicting types for `nprintf'
C:/PS2Dev/ps2lib/ee/include/kernel.h:291: previous declaration of `nprintf'
main.c: In function `main':
main.c:129: warning: implicit declaration of function `sif_rpc_init'
main.c:167: warning: implicit declaration of function `k_FlushCache'
make: *** [main.o] Error 1

So then I decided to comment out the printf.h include in main.c as it's already possibly declared. Run make again:

ee-gcc -O2 -EL -pipe -Wall -Wa,-al -fno-common -Wall -mips3 -ffreestanding -fno-builtin -fshort-double -nostartfiles -mlong64 -mhard-float -mno-abicalls -c -IC:\PS2Dev\ps2lib/common/include -IC:\PS2Dev\ps2lib/ee/include -c main.c -o main.o
> main.lst
In file included from main.c:31:
/cygdrive/c/PS2Dev/gcc/ee/ee/sys-include/stdlib.h:57: parse error before '(' token
main.c: In function `main':
main.c:129: warning: implicit declaration of function `sif_rpc_init'
main.c:167: warning: implicit declaration of function `k_FlushCache'
make: *** [main.o] Error 1

Fixed three errors but I can't get any further. Can anyone advise if I am going about this correctly?
User avatar
Lukasz
Posts: 248
Joined: Mon Jan 19, 2004 8:37 pm
Location: Denmark
Contact:

Post by Lukasz »

ps2lib's function names have changed a litte, sif_rpc_init is now SifRpcInit etc. But you can include compat.h (i think..) and you can use the old function names.

Also it might be worth switching to ps2sdk since its ps2lib and ps2drv merged.
Yoda
Posts: 1
Joined: Tue Aug 17, 2004 5:40 am
Location: London, UK

Post by Yoda »

Hi,
im having exactly the same problem.
Ive included compat.h and it worked to get rid of the warnings about implicitly declaring those two functions but i still get the following parse error and cant figure out what wrong.

ee-gcc -O2 -EL -pipe -Wall -Wa,-al -fno-common -Wall -march=r5900 -ffreestanding -fno-builtin -fshort-double -nostartfiles -mlong64 -mhard-float -mno-abicalls -c -IC:\PS2Dev\ps2lib/common/include -IC:\PS2Dev\ps2lib/ee/include -c main.c -o main.o > main.lst
In file included from main.c:31:
/cygdrive/c/PS2Dev/gcc/ee/ee/sys-include/stdlib.h:57: parse error before '(' token
make: *** [main.o] Error 1

any help would be appreciated.

thanks
User avatar
Lukasz
Posts: 248
Joined: Mon Jan 19, 2004 8:37 pm
Location: Denmark
Contact:

Post by Lukasz »

Well, I don't think you want to include cygdrive/c/PS2Dev/gcc/ee/ee/sys-include/stdlib.h, try putting -nostdlib as a link argument, it will ignore the gcc standard libs, i'm not 100% sure it will fix your included header problem, but its worth a shot.

If you absolutely need stdlib.h, try to see if the functions you need from stdlib.h aren't also included in ps2lib, it does contain string functions, malloc, printf, etc.

If you are porting something, newlib might be worth considering, since it contains alot of the standard C libs, although I recommend that you do not use it, since it isn't optimized very well for PS2 in some parts.
Shine
Posts: 728
Joined: Fri Dec 03, 2004 12:10 pm
Location: Germany

Re: Error compiling starsim using Win32 Dev

Post by Shine »

sausage wrote:I have just installed a fresh version of Win32 dev using the batch file option. I downloaded starsim to try compiling.

I unpacked the starsim demo source and typed:

make

I get the following:
ee-gcc -O2 -EL -pipe -Wall -Wa,-al -fno-common -Wall -mips3 -mcpu=r5900 -ffreestanding -fnonnull-objects -fno-builtin -fshort-double -nostartfiles -mlong64 -mhard-float -mno-abicalls -c -IC:\PS2Dev\ps2lib/common/include -IC:\PS2Dev\ps2lib/ee/include -c main.c -o main.o > main.lst
cc1: unrecognized option `-fnonnull-objects'
/cygdrive/c/PS2Dev/gcc/ee/bin/../lib/gcc-lib/ee/3.2.2/../../../../ee/bin/as: unrecognized option `-mcpu=r5900'
make: *** [main.o] Error 1
If you solve this problem, you'll get some more :-) Try my changed package from http://www.frank-buss.de/ps2/starsim.zip and please report, if it works and if my new vector font addition works on your PS.
Post Reply