Unable to compile

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

Moderators: cheriff, Herben

Post Reply
Yndostrui
Posts: 6
Joined: Sat Aug 08, 2009 9:00 am

Unable to compile

Post by Yndostrui »

Hello...
well, if I create my own program it doesn't compile...
The examples compile correctly, as long as there is the *.o file. If I delete it, or do "make clean" it doesn't work either...

Here's my code: (Although I don't think it's this important)

Code: Select all

#include <tamtypes.h>
#include <kernel.h>
#include <sifrpc.h>
#include <stdio.h>
#include <debug.h>

int main&#40;int argc, char *argv&#91;&#93;&#41;
&#123;
    SifInitRpc&#40;0&#41;;
    
    init_scr&#40;&#41;;
    scr_printf&#40;"Hello World!\n"&#41;;
    printf&#40;"Hello World!\n"&#41;;
    
    return 0;
&#125;
This is my makefile:

Code: Select all

EE_BIN = hello.elf
EE_OBJS = hello.o
EE_LIBS = -ldebug

all&#58; $&#40;EE_BIN&#41;

clean&#58;
	rm -f *.elf *.o *.a

include $&#40;PS2SDK&#41;/Makefile.pref
include $&#40;PS2SDK&#41;/Makefile.eeglobal
And this is a log from msys:

Code: Select all

$ make
ee-gcc -D_EE -O2 -G0 -Wall  -I/usr/local/ps2dev/ps2sdk/ee/include -I/usr/local/p
s2dev/ps2sdk/common/include -I.  -I/usr/local/ps2dev/ps2sdk/ports -I/usr/local/p
s2dev/ps2sdk/ports/include -c hello.c -o hello.o
In file included from hello.c&#58;4&#58;
D&#58;/PS2Dev/msys/1.0/local/ps2dev/ps2sdk/ee/include/stdio.h&#58;21&#58;23&#58; sys/types.h&#58; No
 such file or directory
In file included from hello.c&#58;4&#58;
D&#58;/PS2Dev/msys/1.0/local/ps2dev/ps2sdk/ee/include/stdio.h&#58;34&#58; parse error before
 "read"
D&#58;/PS2Dev/msys/1.0/local/ps2dev/ps2sdk/ee/include/stdio.h&#58;34&#58; warning&#58; return ty
pe defaults to `int'
D&#58;/PS2Dev/msys/1.0/local/ps2dev/ps2sdk/ee/include/stdio.h&#58;35&#58; parse error before
 "write"
D&#58;/PS2Dev/msys/1.0/local/ps2dev/ps2sdk/ee/include/stdio.h&#58;35&#58; warning&#58; return ty
pe defaults to `int'
D&#58;/PS2Dev/msys/1.0/local/ps2dev/ps2sdk/ee/include/stdio.h&#58;36&#58; parse error before
 "lseek"
D&#58;/PS2Dev/msys/1.0/local/ps2dev/ps2sdk/ee/include/stdio.h&#58;36&#58; parse error before
 "off_t"
D&#58;/PS2Dev/msys/1.0/local/ps2dev/ps2sdk/ee/include/stdio.h&#58;36&#58; warning&#58; return ty
pe defaults to `int'
D&#58;/PS2Dev/msys/1.0/local/ps2dev/ps2sdk/ee/include/stdio.h&#58; In function `lseek'&#58;
D&#58;/PS2Dev/msys/1.0/local/ps2dev/ps2sdk/ee/include/stdio.h&#58;36&#58; `handle' undeclare
d &#40;first use in this function&#41;
D&#58;/PS2Dev/msys/1.0/local/ps2dev/ps2sdk/ee/include/stdio.h&#58;36&#58; &#40;Each undeclared i
dentifier is reported only once
D&#58;/PS2Dev/msys/1.0/local/ps2dev/ps2sdk/ee/include/stdio.h&#58;36&#58; for each function
it appears in.&#41;
D&#58;/PS2Dev/msys/1.0/local/ps2dev/ps2sdk/ee/include/stdio.h&#58;36&#58; `position' undecla
red &#40;first use in this function&#41;
D&#58;/PS2Dev/msys/1.0/local/ps2dev/ps2sdk/ee/include/stdio.h&#58;36&#58; `wheel' undeclared
 &#40;first use in this function&#41;
D&#58;/PS2Dev/msys/1.0/local/ps2dev/ps2sdk/ee/include/stdio.h&#58; At top level&#58;
D&#58;/PS2Dev/msys/1.0/local/ps2dev/ps2sdk/ee/include/stdio.h&#58;37&#58; parse error before
 "tell"
D&#58;/PS2Dev/msys/1.0/local/ps2dev/ps2sdk/ee/include/stdio.h&#58;37&#58; warning&#58; return ty
pe defaults to `int'
make&#58; *** &#91;hello.o&#93; Error 1

Xandaros@GWDMZ-1725646D /local/ps2dev/ps2sdk/projects/helloworld
Once again, it's the same for the samples...

Ynd
User avatar
jbit
Site Admin
Posts: 293
Joined: Sat May 28, 2005 3:11 am
Location: København, Danmark
Contact:

Post by jbit »

Sounds like it can't find the GCC headers... which are usually in $PS2DEv/ee/ee/include.. Could be an incomplete toolchain installation? or you've moved the ee-gcc binary somewhere it shouldn't be...
do you have "D:/PS2Dev/msys/1.0/local/ps2dev/ee/ee/include/sys/types.h" (I'm guessing that's where it'll be anyway) and what does "which ee-gcc" return?
Yndostrui
Posts: 6
Joined: Sat Aug 08, 2009 9:00 am

Post by Yndostrui »

Yes it is there, I used the direct download of everything, because I had a small problom installing it and I didn't want to spent this much time for just installing and so I downloaded everything pre-build.
(http://ps2dev.org/ps2/Tutorials/TUTORIA ... %5D_PS2SDK)

"which e-gcc" returns "/usr/local/ps2dev/ee/bin/ee-gcc"
User avatar
jbit
Site Admin
Posts: 293
Joined: Sat May 28, 2005 3:11 am
Location: København, Danmark
Contact:

Post by jbit »

and what's the output of

Code: Select all

echo "main&#40;&#41; &#123;&#125;" | ee-gcc --verbose -E -
?
Yndostrui
Posts: 6
Joined: Sat Aug 08, 2009 9:00 am

Post by Yndostrui »

Code: Select all

Reading specs from D&#58;\PS2Dev\msys\1.0\local\ps2dev\ee\bin\..\lib\gcc-lib\ee\3.2.
2\specs
Configured with&#58; ../configure --prefix=/usr/local/ps2dev/ee --target=ee --enable
-languages=c,c++ --with-newlib --with-headers=/usr/local/ps2dev/ee/ee/include --
enable-cxx-flags=-G0
Thread model&#58; single
gcc version 3.2.2
 D&#58;\PS2Dev\msys\1.0\local\ps2dev\ee\bin\..\lib\gcc-lib\ee\3.2.2\cpp0.exe -lang-c
 -v -iprefix D&#58;\PS2Dev\msys\1.0\local\ps2dev\ee\bin\..\lib/gcc-lib/ee\3.2.2\ -D_
_GNUC__=3 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=2 -D__GXX_ABI_VERSION=102 -D_
_ELF__ -Dmips -D_mips -D__mips -D__mips__ -DR5900 -D_R5900 -D__R5900 -D_EE -DR30
00 -D_3000 -D__3000 -DMIPSEL -D_MIPSEL -D__MIPSEL -D__MIPSEL__ -D__ELF__ -D__mip
s__ -D__mips__ -D__mips -D__mips__ -D__R5900__ -D_R5900 -D__R5900 -D_EE -D__R300
0__ -D__3000__ -D__3000 -D__MIPSEL__ -D_MIPSEL -D__MIPSEL -D__MIPSEL__ -D__mips
-D__mips -D__R5900 -D__R3000 -D__3000 -D__MIPSEL -Acpu&#40;mips&#41; -Amachine&#40;mips&#41; -D_
_NO_INLINE__ -D__STDC_HOSTED__=1 -D__LANGUAGE_C -D_LANGUAGE_C -DLANGUAGE_C -D_MI
PS_SZPTR=32 -D_MIPS_SZINT=32 -D__SIZE_TYPE__=unsigned int -D__SSIZE_TYPE__=int -
D__PTRDIFF_TYPE__=int -D_MIPS_SZLONG=64 -D__mips_fpr=64 -D_MIPS_FPSET=32 -U__mip
s -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS3 -D__mips=3 -D__mips64 -D__mips_eabi -D
__mips_single_float -D__LANGUAGE_C__ -DLANGUAGE_C -
GNU CPP version 3.2.2 &#40;cpplib&#41; &#91;AL 1.1, MM 40&#93; &#40;MIPSel R5900 ELF&#41;
ignoring nonexistent directory "/usr/local/ps2dev/ee/include"
ignoring nonexistent directory "C&#58;/msys/1.0/local/ps2dev/ee/lib/gcc-lib/ee/3.2.2
/include"
ignoring nonexistent directory "C&#58;/msys/1.0/local/ps2dev/ee/ee/sys-include"
ignoring nonexistent directory "C&#58;/msys/1.0/local/ps2dev/ee/ee/include"
#include "..." search starts here&#58;
#include <...> search starts here&#58;
 D&#58;/PS2Dev/msys/1.0/local/ps2dev/ee/lib/gcc-lib/ee/3.2.2/include
End of search list.
# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "<stdin>"
main&#40;&#41; &#123;&#125;
Oh... it has to be in C... Is there any way to change it?
User avatar
jbit
Site Admin
Posts: 293
Joined: Sat May 28, 2005 3:11 am
Location: København, Danmark
Contact:

Post by jbit »

I have no idea about the mingw32 toolchain, but it seems like the path is hardcoded, the only way I could think of changing it is either recompiling the toolchain or just making a link from c:/msys to d:/ps2dev/msys (windows does support symlinks: http://technet.microsoft.com/en-us/libr ... 10%29.aspx)
Yndostrui
Posts: 6
Joined: Sat Aug 08, 2009 9:00 am

Post by Yndostrui »

Unfortunately (or maybe luckily?), I'm using XP...

Well, the pathes have to be saved anywhere... However, I'm gonna copy it to C...

Xan
User avatar
jbit
Site Admin
Posts: 293
Joined: Sat May 28, 2005 3:11 am
Location: København, Danmark
Contact:

Post by jbit »

Yndostrui
Posts: 6
Joined: Sat Aug 08, 2009 9:00 am

Post by Yndostrui »

Oh, thank you :)

What a useful tool... I think I'm gonna keep it :D

Xan
LBGSHI
Posts: 136
Joined: Mon Aug 07, 2006 5:56 am
Contact:

Post by LBGSHI »

Ack, I didn't consider relative paths in the pre-built SDK...at the very least, I should include a note concerning that in the ReadMe.

I wonder what the best fix for this issue would be, so that others intending to use a location on another drive (or drive letter, at least) won't have to modify anything...

Ideas?
I may be lazy, but I can...zzzZZZzzzZZZzzz...
Yndostrui
Posts: 6
Joined: Sat Aug 08, 2009 9:00 am

Post by Yndostrui »

If you know where the paths are saved, you could make a batch file/program altering them...

Xan
LBGSHI
Posts: 136
Joined: Mon Aug 07, 2006 5:56 am
Contact:

Post by LBGSHI »

That's one way of accomplishing it, I suppose. I could make a quick batch script that would prompt the user for the location of the SDK, and modify the environment variables as such...
I may be lazy, but I can...zzzZZZzzzZZZzzz...
Post Reply