| View previous topic :: View next topic |
| Author |
Message |
Yndostrui
Joined: 08 Aug 2009 Posts: 6
|
Posted: Sat Aug 08, 2009 6:51 pm Post subject: Unable to compile |
|
|
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: | #include <tamtypes.h>
#include <kernel.h>
#include <sifrpc.h>
#include <stdio.h>
#include <debug.h>
int main(int argc, char *argv[])
{
SifInitRpc(0);
init_scr();
scr_printf("Hello World!\n");
printf("Hello World!\n");
return 0;
} |
This is my makefile:
| Code: | EE_BIN = hello.elf
EE_OBJS = hello.o
EE_LIBS = -ldebug
all: $(EE_BIN)
clean:
rm -f *.elf *.o *.a
include $(PS2SDK)/Makefile.pref
include $(PS2SDK)/Makefile.eeglobal |
And this is a log from msys:
| Code: | $ 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:4:
D:/PS2Dev/msys/1.0/local/ps2dev/ps2sdk/ee/include/stdio.h:21:23: sys/types.h: No
such file or directory
In file included from hello.c:4:
D:/PS2Dev/msys/1.0/local/ps2dev/ps2sdk/ee/include/stdio.h:34: parse error before
"read"
D:/PS2Dev/msys/1.0/local/ps2dev/ps2sdk/ee/include/stdio.h:34: warning: return ty
pe defaults to `int'
D:/PS2Dev/msys/1.0/local/ps2dev/ps2sdk/ee/include/stdio.h:35: parse error before
"write"
D:/PS2Dev/msys/1.0/local/ps2dev/ps2sdk/ee/include/stdio.h:35: warning: return ty
pe defaults to `int'
D:/PS2Dev/msys/1.0/local/ps2dev/ps2sdk/ee/include/stdio.h:36: parse error before
"lseek"
D:/PS2Dev/msys/1.0/local/ps2dev/ps2sdk/ee/include/stdio.h:36: parse error before
"off_t"
D:/PS2Dev/msys/1.0/local/ps2dev/ps2sdk/ee/include/stdio.h:36: warning: return ty
pe defaults to `int'
D:/PS2Dev/msys/1.0/local/ps2dev/ps2sdk/ee/include/stdio.h: In function `lseek':
D:/PS2Dev/msys/1.0/local/ps2dev/ps2sdk/ee/include/stdio.h:36: `handle' undeclare
d (first use in this function)
D:/PS2Dev/msys/1.0/local/ps2dev/ps2sdk/ee/include/stdio.h:36: (Each undeclared i
dentifier is reported only once
D:/PS2Dev/msys/1.0/local/ps2dev/ps2sdk/ee/include/stdio.h:36: for each function
it appears in.)
D:/PS2Dev/msys/1.0/local/ps2dev/ps2sdk/ee/include/stdio.h:36: `position' undecla
red (first use in this function)
D:/PS2Dev/msys/1.0/local/ps2dev/ps2sdk/ee/include/stdio.h:36: `wheel' undeclared
(first use in this function)
D:/PS2Dev/msys/1.0/local/ps2dev/ps2sdk/ee/include/stdio.h: At top level:
D:/PS2Dev/msys/1.0/local/ps2dev/ps2sdk/ee/include/stdio.h:37: parse error before
"tell"
D:/PS2Dev/msys/1.0/local/ps2dev/ps2sdk/ee/include/stdio.h:37: warning: return ty
pe defaults to `int'
make: *** [hello.o] Error 1
Xandaros@GWDMZ-1725646D /local/ps2dev/ps2sdk/projects/helloworld |
Once again, it's the same for the samples...
Ynd |
|
| Back to top |
|
 |
jbit Site Admin

Joined: 28 May 2005 Posts: 293 Location: København, Danmark
|
Posted: Sat Aug 08, 2009 7:33 pm Post subject: |
|
|
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? |
|
| Back to top |
|
 |
Yndostrui
Joined: 08 Aug 2009 Posts: 6
|
Posted: Sat Aug 08, 2009 8:36 pm Post subject: |
|
|
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/TUTORIAL_3_-_Setting_up_Compilers_and_Development_Environment/PS2SDK_Setup_III_-_Pre-built,_Win32_%5BMinGW/msys%5D_PS2SDK)
"which e-gcc" returns "/usr/local/ps2dev/ee/bin/ee-gcc" |
|
| Back to top |
|
 |
jbit Site Admin

Joined: 28 May 2005 Posts: 293 Location: København, Danmark
|
Posted: Sat Aug 08, 2009 8:41 pm Post subject: |
|
|
and what's the output of
| Code: | | echo "main() {}" | ee-gcc --verbose -E - |
? |
|
| Back to top |
|
 |
Yndostrui
Joined: 08 Aug 2009 Posts: 6
|
Posted: Sat Aug 08, 2009 9:00 pm Post subject: |
|
|
| Code: | Reading specs from D:\PS2Dev\msys\1.0\local\ps2dev\ee\bin\..\lib\gcc-lib\ee\3.2.
2\specs
Configured with: ../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: single
gcc version 3.2.2
D:\PS2Dev\msys\1.0\local\ps2dev\ee\bin\..\lib\gcc-lib\ee\3.2.2\cpp0.exe -lang-c
-v -iprefix D:\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(mips) -Amachine(mips) -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 (cpplib) [AL 1.1, MM 40] (MIPSel R5900 ELF)
ignoring nonexistent directory "/usr/local/ps2dev/ee/include"
ignoring nonexistent directory "C:/msys/1.0/local/ps2dev/ee/lib/gcc-lib/ee/3.2.2
/include"
ignoring nonexistent directory "C:/msys/1.0/local/ps2dev/ee/ee/sys-include"
ignoring nonexistent directory "C:/msys/1.0/local/ps2dev/ee/ee/include"
#include "..." search starts here:
#include <...> search starts here:
D:/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() {} |
Oh... it has to be in C... Is there any way to change it? |
|
| Back to top |
|
 |
jbit Site Admin

Joined: 28 May 2005 Posts: 293 Location: København, Danmark
|
Posted: Sat Aug 08, 2009 9:35 pm Post subject: |
|
|
| 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/library/cc753194%28WS.10%29.aspx) |
|
| Back to top |
|
 |
Yndostrui
Joined: 08 Aug 2009 Posts: 6
|
Posted: Sun Aug 09, 2009 2:38 am Post subject: |
|
|
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 |
|
| Back to top |
|
 |
jbit Site Admin

Joined: 28 May 2005 Posts: 293 Location: København, Danmark
|
|
| Back to top |
|
 |
Yndostrui
Joined: 08 Aug 2009 Posts: 6
|
Posted: Sun Aug 09, 2009 3:16 am Post subject: |
|
|
Oh, thank you :)
What a useful tool... I think I'm gonna keep it :D
Xan |
|
| Back to top |
|
 |
LBGSHI
Joined: 07 Aug 2006 Posts: 136
|
Posted: Mon Aug 10, 2009 12:40 am Post subject: |
|
|
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... |
|
| Back to top |
|
 |
Yndostrui
Joined: 08 Aug 2009 Posts: 6
|
Posted: Mon Aug 10, 2009 12:48 am Post subject: |
|
|
If you know where the paths are saved, you could make a batch file/program altering them...
Xan |
|
| Back to top |
|
 |
LBGSHI
Joined: 07 Aug 2006 Posts: 136
|
Posted: Mon Aug 10, 2009 12:55 am Post subject: |
|
|
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... |
|
| Back to top |
|
 |
|