in reply to Re: Error compiling XS code with strawberry-perl 5.8.8-alpha-2
in thread [Solved] Error compiling XS code with strawberry-perl 5.8.8-alpha-2

I'm experiencing a problem that seems very close to yours. I am running (rele3ased) Vista 64, and Strawberry Perl Alpha 2.

Compile attempts fail - see snippets below - I'm trying to install Date::Calc. The pre-req Bit::Vector fails ...

cp lib/Bit/Vector/String.pod blib\lib\Bit\Vector\String.pod cp lib/Bit/Vector/String.pm blib\lib\Bit\Vector\String.pm gcc -c -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTE +XT -DPERL_IMPLICIT_S YS -fno-strict-aliasing -DPERL_MSVCRT_READFIX -s -O2 -DVERSION=\" +6.4\" -DXS_VERSI ON=\"6.4\" "-IC:\strawberry-perl\perl\lib\CORE" BitVector.c gcc: installation problem, cannot exec `cc1': No such file or director +y dmake.EXE: Error code 129, while making 'BitVector.o' C:\strawberry-perl\dmake\bin\dmake.EXE -- NOT OK
Then, Date::Calc compile also fails:
cp Calc.pm blib\lib\Date\Calc.pm C:\strawberry-perl\perl\bin\perl.exe C:\strawberry-perl\perl\lib\ExtUt +ils\xsubpp -typemap C:\strawberry-perl\perl\lib\ExtUtils\typemap -typemap typemap Calc.x +s > Calc.xsc && C:\s trawberry-perl\perl\bin\perl.exe -MExtUtils::Command -e mv Calc.xsc Ca +lc.c gcc -c -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTE +XT -DPERL_IMPLICIT_S YS -fno-strict-aliasing -DPERL_MSVCRT_READFIX -s -O2 -DVERSION=\" +5.4\" -DXS_VERSI ON=\"5.4\" "-IC:\strawberry-perl\perl\lib\CORE" Calc.c gcc: installation problem, cannot exec `cc1': No such file or director +y dmake.EXE: Error code 129, while making 'Calc.o' C:\strawberry-perl\dmake\bin\dmake.EXE -- NOT OK Running make test ...
I removed Activestate because I could not get PPM (64-bit) to work - was hoping for more luck with Strawberry. Sthis is a one-time install, so my ENV is clean.

Update 1:I made marginal progress on this, by copying cc1.exe from C:\strawberry-perl\mingw\mingw32\bin (which is NOT in the PATH) to C:\strawberry-perl\dmake\bin which IS in the PATH. The process now finds, and runs cc1, but there is a new issue:

It appears that the INCLUDE path C:\strawberry-perl\mingw\include is being ignored - the compile fails because it cannot find a multitude of header (.h) files. Please help - I am not a C programmer.

Writing Makefile for Bit::Vector Writing patchlevel.h for C:\strawberry-perl\perl\bin\perl.exe (5.00800 +8) cp lib/Bit/Vector/Overload.pm blib\lib\Bit\Vector\Overload.pm cp Vector.pm blib\lib\Bit\Vector.pm cp Vector.pod blib\lib\Bit\Vector.pod cp lib/Bit/Vector/Overload.pod blib\lib\Bit\Vector\Overload.pod cp lib/Bit/Vector/String.pod blib\lib\Bit\Vector\String.pod cp lib/Bit/Vector/String.pm blib\lib\Bit\Vector\String.pm gcc -c -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTE +XT -DPERL_IMPLICIT_S YS -fno-strict-aliasing -DPERL_MSVCRT_READFIX -s -O2 -DVERSION=\" +6.4\" -DXS_VERSI ON=\"6.4\" "-IC:\strawberry-perl\perl\lib\CORE" BitVector.c BitVector.c:8:80: stdlib.h: No such file or directory BitVector.c:9:80: limits.h: No such file or directory BitVector.c:10:80: string.h: No such file or directory BitVector.c:11:80: ctype.h: No such file or directory BitVector.c: In function `BitVector_Error': BitVector.c:508: error: `NULL' undeclared (first use in this function) BitVector.c:508: error: (Each undeclared identifier is reported only o +nce BitVector.c:508: error: for each function it appears in.) BitVector.c: In function `BitVector_Boot': BitVector.c:547: error: `size_t' undeclared (first use in this functio +n) BitVector.c:580: error: `NULL' undeclared (first use in this function) ... many more syntax errors because it cannot find .h files ......
Update 2: SUCCESS!

Finally got Date::Calc and dependents to compile and install after a few more hacks:

copy C:\strawberry-perl\mingw\lib\gcc\mingw32\3.4.5\include C:\strawbe +rry-perl\perl\lib\CORE copy /s C:\strawberry-perl\mingw\include C:\strawberry-perl\perl\lib\C +ORE set LIBRARY_PATH=C:\strawberry-perl\mingw\lib;C:\strawberry-perl\mingw +\lib\gcc\mingw32\3.4.5
Admittedly, these are not good things to do - I'm hoping the Strawberry perl developers will put the right includes in their install process.

I have never posted a per bug report before, and am a little shy on that - is this an appropriate thing to post on their forum ?

     "A closed mouth gathers no feet." --Unknown

Replies are listed 'Best First'.
Re^3: Error compiling XS code with strawberry-perl 5.8.8-alpha-2
by syphilis (Archbishop) on Dec 07, 2006 at 14:21 UTC
    I installed strawberry-perl-5.8.8-alpha-2.exe, and Bit-Vector-6.4 builds and installs cleanly for me. ('cc1.exe' is not in my path.)

    I don't know what accounts for the difference that you and I are seeing. (Do you ?) Perhaps someone a little closer to the development of Strawbewrry Perl can provide an understanding.

    Cheers,
    Rob
Re^3: Error compiling XS code with strawberry-perl 5.8.8-alpha-2
by xdg (Monsignor) on Jan 17, 2007 at 15:12 UTC

    Sorry I missed this back in December. This looks like a problem with PATH, LIB and INCLUDE being set properly on installation. Were you running with administrator privileges? (If you remember at this point, that is.) Strawberry probably needs to provide a better warning to the user if it is not able to set the PATH appropriately. Thanks for being patient with it.

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

Re^3: Error compiling XS code with strawberry-perl 5.8.8-alpha-2
by Anonymous Monk on Dec 07, 2006 at 07:01 UTC
    Don't copy/paste files, modify your %PATH%, %INCLUDE% ... on the other hand, install a stable release (vanilla, not strawberry).