## Help compiling my program

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

Moderators: cheriff, Herben

methos3
Posts: 89
Joined: Fri Feb 01, 2008 3:21 am

### Help compiling my program

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 [email protected] /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&#58;5, from tool_definition.c&#58;1, from functions.c&#58;1&#58; c&#58;/ps2dev/ps2sdk/ee/include/stdio.h&#58;21&#58;23&#58; sys/types.h&#58; No such file or director y In file included from default_incs.c&#58;5, from tool_definition.c&#58;1, from functions.c&#58;1&#58; c&#58;/ps2dev/ps2sdk/ee/include/stdio.h&#58;34&#58; parse error before "read" c&#58;/ps2dev/ps2sdk/ee/include/stdio.h&#58;34&#58; warning&#58; return type defaults to int' c&#58;/ps2dev/ps2sdk/ee/include/stdio.h&#58;35&#58; parse error before "write" c&#58;/ps2dev/ps2sdk/ee/include/stdio.h&#58;35&#58; warning&#58; return type defaults to int' c&#58;/ps2dev/ps2sdk/ee/include/stdio.h&#58;36&#58; parse error before "lseek" c&#58;/ps2dev/ps2sdk/ee/include/stdio.h&#58;36&#58; parse error before "off_t" c&#58;/ps2dev/ps2sdk/ee/include/stdio.h&#58;36&#58; warning&#58; return type defaults to int' c&#58;/ps2dev/ps2sdk/ee/include/stdio.h&#58; In function lseek'&#58; c&#58;/ps2dev/ps2sdk/ee/include/stdio.h&#58;36&#58; handle' undeclared &#40;first use in this f unction&#41; c&#58;/ps2dev/ps2sdk/ee/include/stdio.h&#58;36&#58; &#40;Each undeclared identifier is reported only once c&#58;/ps2dev/ps2sdk/ee/include/stdio.h&#58;36&#58; for each function it appears in.&#41; c&#58;/ps2dev/ps2sdk/ee/include/stdio.h&#58;36&#58; position' undeclared &#40;first use in this function&#41; c&#58;/ps2dev/ps2sdk/ee/include/stdio.h&#58;36&#58; wheel' undeclared &#40;first use in this fu nction&#41; c&#58;/ps2dev/ps2sdk/ee/include/stdio.h&#58; At top level&#58; c&#58;/ps2dev/ps2sdk/ee/include/stdio.h&#58;37&#58; parse error before "tell" c&#58;/ps2dev/ps2sdk/ee/include/stdio.h&#58;37&#58; warning&#58; return type defaults to int' make&#58; *** &#91;functions.o&#93; Error 1 Yan [email protected] /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?
ragnarok2040
Posts: 202
Joined: Wed Aug 09, 2006 1:00 am
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.
methos3
Posts: 89
Joined: Fri Feb 01, 2008 3:21 am
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...
ragnarok2040
Posts: 202
Joined: Wed Aug 09, 2006 1:00 am
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?
methos3
Posts: 89
Joined: Fri Feb 01, 2008 3:21 am

Code: Select all

Yan [email protected] /c/ps2dev/Projetos/MCReader
\$ ee-gcc -v
Reading specs from c&#58;\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
gcc version 3.2.2
This.
methos3
Posts: 89
Joined: Fri Feb 01, 2008 3:21 am
hey, wait a second...
Configured with: ../configure --prefix=/usr/local/ps2dev/ee
??
Shouldn't it be /c/ps2dev?
ragnarok2040
Posts: 202
Joined: Wed Aug 09, 2006 1:00 am
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.
methos3
Posts: 89
Joined: Fri Feb 01, 2008 3:21 am
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!
ragnarok2040
Posts: 202
Joined: Wed Aug 09, 2006 1:00 am
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.
methos3
Posts: 89
Joined: Fri Feb 01, 2008 3:21 am
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!

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).