forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Unable to compile

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
Yndostrui



Joined: 08 Aug 2009
Posts: 6

PostPosted: Sat Aug 08, 2009 6:51 pm    Post subject: Unable to compile Reply with quote

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
View user's profile Send private message
jbit
Site Admin


Joined: 28 May 2005
Posts: 293
Location: København, Danmark

PostPosted: Sat Aug 08, 2009 7:33 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Yndostrui



Joined: 08 Aug 2009
Posts: 6

PostPosted: Sat Aug 08, 2009 8:36 pm    Post subject: Reply with quote

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
View user's profile Send private message
jbit
Site Admin


Joined: 28 May 2005
Posts: 293
Location: København, Danmark

PostPosted: Sat Aug 08, 2009 8:41 pm    Post subject: Reply with quote

and what's the output of
Code:
echo "main() {}" | ee-gcc --verbose -E -

?
Back to top
View user's profile Send private message Visit poster's website
Yndostrui



Joined: 08 Aug 2009
Posts: 6

PostPosted: Sat Aug 08, 2009 9:00 pm    Post subject: Reply with quote

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
View user's profile Send private message
jbit
Site Admin


Joined: 28 May 2005
Posts: 293
Location: København, Danmark

PostPosted: Sat Aug 08, 2009 9:35 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Yndostrui



Joined: 08 Aug 2009
Posts: 6

PostPosted: Sun Aug 09, 2009 2:38 am    Post subject: Reply with quote

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
View user's profile Send private message
jbit
Site Admin


Joined: 28 May 2005
Posts: 293
Location: København, Danmark

PostPosted: Sun Aug 09, 2009 2:40 am    Post subject: Reply with quote

http://technet.microsoft.com/sv-se/sysinternals/bb896768%28en-us%29.aspx
Back to top
View user's profile Send private message Visit poster's website
Yndostrui



Joined: 08 Aug 2009
Posts: 6

PostPosted: Sun Aug 09, 2009 3:16 am    Post subject: Reply with quote

Oh, thank you :)

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

Xan
Back to top
View user's profile Send private message
LBGSHI



Joined: 07 Aug 2006
Posts: 136

PostPosted: Mon Aug 10, 2009 12:40 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Yndostrui



Joined: 08 Aug 2009
Posts: 6

PostPosted: Mon Aug 10, 2009 12:48 am    Post subject: Reply with quote

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

Xan
Back to top
View user's profile Send private message
LBGSHI



Joined: 07 Aug 2006
Posts: 136

PostPosted: Mon Aug 10, 2009 12:55 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group