Cosimo Streppone found that adding "c:\strawberry-perl\mingw\libexec\gcc\mingw32\3.4.5" to the PATH environment variable fixed compilation errors
I'd be surprised if the fix was as simple as that. Admittedly that will fix the cannot exec `cc1' error - but the errors don't end there. It's certainly not good enough when it comes to compiling basic C scripts:
C:\C>type try.c
#include <stdio.h>
int main(void) {
printf("Hello World\n");
return 0;
}
C:\C>gcc -o try.exe try.c
gcc: installation problem, cannot exec `cc1': No such file or director
+y
C:\C>set PATH=C:\strawberry\c\libexec\gcc\mingw32\3.4.5;%PATH%
C:\C>gcc -o try.exe try.c
try.c:1:19: no include path in which to search for stdio.h
C:\C>
And any compilation that includes perl.h fails, since the the standard C headers that perl.h includes aren't found.
I think that approach is a path to nowhere (though, admittedly, I haven't wandered very far down it). Each time one error is fixed, another pops up to replace it .... but if someone *does* have a solution for g77 (that avoids the need for a patched g77.exe) I'd be most grateful to hear it.
Cheers, Rob | [reply] [d/l] [select] |
INCLUDE=C:\strawberry\c\include;C:\strawberry\perl\lib\CORE;C:\Program
+ Files\GnuWin32\include
LIB=C:\strawberry\c\lib;C:\strawberry\perl\bin;C:\Program Files\GnuWin
+32\lib
(The GnuWin32 were my own addition -- the others are provided by Strawberry on installation.)
If you don't have those set, try setting them and compiling again.
-xdg
Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
| [reply] [d/l] |
If you don't have those set, try setting them and compiling again
I have:
INCLUDE=;C:\strawberry-perl\mingw\include;C:\strawberry-perl\perl\lib\
+CORE;C:\strawberry-perl\perl\lib\encode;C:\strawberry\c\include;C:\st
+rawberry\perl\lib\CORE;C:\strawberry\c\include;C:\strawberry\perl\lib
+\CORE
LIB=;C:\strawberry-perl\mingw\lib;C:\strawberry-perl\perl\bin;C:\straw
+berry\c\li
b;C:\strawberry\perl\bin;C:\strawberry\c\lib;C:\strawberry\perl\bin
They're all there except for the GnuWin32\include. There's certainly plenty of locations mentioned there that contain stdio.h - though the error is not that stdio.h can't be found, but that there's no path in which to search for it.
I thought I got past that error at one time, but now I find I can only avoid the no include path in which to search for stdio.h error by commenting out #include <stdio.h> in the source file ... but then I get:
ld: crt2.o: No such file: No such file or directory
The issue has come up a number of times on the MinGW mailing list, and the solution has always been to use the patched executables - or to rebuild MinGW using the patched source. (No other solutions have been offered, afaik.) Rebuilding MinGW would certainly fix my issue with g77, but I've yet to find instructions (that I can comprehend) on how to do that. Unfortunately, whilst various people have made available patched versions of gcc, g++ and collect2, no-one has yet provided a patched version of g77.
I appreciate you taking the time to consider this issue, btw.
Cheers, Rob
Update: For a bit of an explanation of what's really going on (and the fixes produced), see the thread http://www.nabble.com/environment-hosed-during-upgrade-to9195667.html
And the best source I know of for the patched executables is http://dessent.net/tmp/gcc-vista-3.4.5-20060117-1.tar.gz. | [reply] [d/l] [select] |