Page 1 of 1

Help compiling my program

Posted: Fri Feb 12, 2010 10:47 pm
by methos3
Hello!
My compiler was working correctly some weeks ago, but now that I've reinstalled Windows on my computer, it won't compile anymore!
Before reformatting my hd, I just copied the ps2dev folder to my pendrive, and after installing Windows, I've installed msys (it's correctly configured), and copied the ps2dev folder again to it's original location.
But, when I type "make", it gives me this error:

Code: Select all

Yan Paulo@YANSPC /c/ps2dev/Projetos/MCReader
$ make -f Makefile
ee-gcc -D_EE -O2 -G0 -Wall  -DHAVE_LIBJPEG -DHAVE_LIBTIFF -DHAVE_LIBPNG -DHAVE_Z
LIB -fno-builtin-printf -I/c/ps2dev/ps2sdk/ee/include -I/c/ps2dev/ps2sdk/common/
include -I.  -I/c/ps2dev/libjpg -I/c/ps2dev/libtiff -I/c/ps2dev/zlib/include -I/
c/ps2dev/libpng/include -I/c/ps2dev/gsKit/ee/gs/include  -I/c/ps2dev/gsKit/ee/dm
a/include -I/c/ps2dev/gsKit/ee/toolkit/include -I/ee -c functions.c -o functions
.o
In file included from default_incs.c:5,
                 from tool_definition.c:1,
                 from functions.c:1:
c:/ps2dev/ps2sdk/ee/include/stdio.h:21:23: sys/types.h: No such file or director
y
In file included from default_incs.c:5,
                 from tool_definition.c:1,
                 from functions.c:1:
c:/ps2dev/ps2sdk/ee/include/stdio.h:34: parse error before "read"
c:/ps2dev/ps2sdk/ee/include/stdio.h:34: warning: return type defaults to `int'
c:/ps2dev/ps2sdk/ee/include/stdio.h:35: parse error before "write"
c:/ps2dev/ps2sdk/ee/include/stdio.h:35: warning: return type defaults to `int'
c:/ps2dev/ps2sdk/ee/include/stdio.h:36: parse error before "lseek"
c:/ps2dev/ps2sdk/ee/include/stdio.h:36: parse error before "off_t"
c:/ps2dev/ps2sdk/ee/include/stdio.h:36: warning: return type defaults to `int'
c:/ps2dev/ps2sdk/ee/include/stdio.h: In function `lseek':
c:/ps2dev/ps2sdk/ee/include/stdio.h:36: `handle' undeclared (first use in this f
unction)
c:/ps2dev/ps2sdk/ee/include/stdio.h:36: (Each undeclared identifier is reported
only once
c:/ps2dev/ps2sdk/ee/include/stdio.h:36: for each function it appears in.)
c:/ps2dev/ps2sdk/ee/include/stdio.h:36: `position' undeclared (first use in this
 function)
c:/ps2dev/ps2sdk/ee/include/stdio.h:36: `wheel' undeclared (first use in this fu
nction)
c:/ps2dev/ps2sdk/ee/include/stdio.h: At top level:
c:/ps2dev/ps2sdk/ee/include/stdio.h:37: parse error before "tell"
c:/ps2dev/ps2sdk/ee/include/stdio.h:37: warning: return type defaults to `int'
make: *** [functions.o] Error 1

Yan Paulo@YANSPC /c/ps2dev/Projetos/MCReader
$
It wants a "sys/types.h" file, but it really doesn't exist in ee/include or common/include.
I tried to recompile the ps2sdk as well, but when compiling it, a window pops up saying that "collect2.exe" stopped working. It's really strange.
I never had this problem before, what should I do?

Posted: Fri Feb 12, 2010 11:43 pm
by ragnarok2040
That header's located in 'ee/ee/include/sys/types.h'. It's part of the toolchain installation so ee-gcc should be able to find it if the toolchain's been installed to the same location...

Maybe your toolchain was corrupted during the transfer? If you're missing just the newlib headers, then maybe compiling and reinstalling newlib will help.

Posted: Fri Feb 12, 2010 11:59 pm
by methos3
ragnarok2040 wrote:That header's located in 'ee/ee/include/sys/types.h'.
Hm, Yes. It's there. I don't believe some files were corrupted. After copying, I've checked the number and size of files. What is this newlib?
It's really strange because I can't compile the ps2sdk as well...

Posted: Sat Feb 13, 2010 1:30 am
by ragnarok2040
Newlib's the standard C library and headers that ee-gcc uses. It's part of compiling the toolchain.

It looks like you have your environment variables setup correctly based on the output. Since that header is part of ee-gcc, it looks like it can't find its own files, which points to a problem with parsing its current location. What's "ee-gcc -v" output?

Posted: Sat Feb 13, 2010 1:47 am
by methos3

Code: Select all

Yan Paulo@YANSPC /c/ps2dev/Projetos/MCReader
$ ee-gcc -v
Reading specs from c:\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
This.

Posted: Sat Feb 13, 2010 2:47 am
by methos3
hey, wait a second...
Configured with: ../configure --prefix=/usr/local/ps2dev/ee
??
Shouldn't it be /c/ps2dev?

Posted: Sat Feb 13, 2010 2:50 am
by ragnarok2040
Yep, that toolchain is configured to be in /usr/local/ps2dev and not at /c/ps2dev or c:/ps2dev. I'm not quite sure how you had it working before.

You can try to create a symlink using something like "ln -s /c/ps2dev /usr/local/ps2dev" or modify the fstab to mount c:/ps2dev to /usr/local/ps2dev. Modifying the fstab might be easier, as I'm not sure if MSYS supports symlinks.

Posted: Sat Feb 13, 2010 3:11 am
by methos3
Weird! Where did this /usr/local/ps2dev come from? The strange thing is that it was a pre-compiled toolchain I downloaded year ago. First, I will try to download/compile the toolchain, because there could be another errors.
If I get this collection2.exe error while compiling the toolchain, I will use one of those tricks(msys does support symlinks, I guess).
Oh, and thanks, ragnarok2040!

Posted: Sat Feb 13, 2010 7:03 am
by ragnarok2040
No problem :D.

That path is hardcoded into the binary when it's compiled so you must've had some sort of special setup that remapped '/usr/local/ps2dev' to '/c/ps2dev' or 'c:/ps2dev' or some other configuration to workaround it before you reinstalled Windows.

For the collect2 problem, it's common on Vista or 7, so if you've upgraded to Vista or 7, you need to install Vista compatible versions of binutils/gcc-core and such as well as compile the toolchain using an extra compile flag "-D__USE_MINGW_ACCESS". If you're using XP, then I'm not sure what the problem might be :S.

I made a thread about halfway down the first page now that has a walkthrough for installing mingw/msys by hand, because of permission issues related to installer detection. It also includes solutions to problems I encountered when compiling the toolchain.

Posted: Sat Feb 13, 2010 11:09 pm
by methos3
Just as I suspected. It's the fisrt problem I'm having with Windows Vista :/
I've never expected any problem with it. Well, I compiled the toolchain using msys in Administrator mode yesterday but didn't test yet (I received an error message, but it was'n anything about collect2.exe).
Propably it won't work, so... I'll take a look at your ppost about vista/7 :D

Thanks again and cya!

[edit]
It worked! I'll probably get the collect2.exe error when compiling the ps2sdk lately, but for now it's ok. I'll take a look at the vista/7 post when I need to compile the ps2sdk :/
[edit2]
impressive! I downloaded the ps2sdk source from the svn just to test, and it compiles! It's a default setup of mingw/msys (I always run msys as Administrator, but no modifications were made).