asz has asked for the wisdom of the Perl Monks concerning the following question:

hello,

i'm using strawberry-perl 5.8.8-alpha-2's version of cpan to install modules. the pure Perl modules install just fine (eg. HTML::Template), but the ones which contain XS parts fail:

#-------------- DBI --------------# dlltool --def DBI.def --output-exp dll.exp dlltool: _spawnvp dmake.EXE: Error code 129, while making 'blib\arch\auto\DBI\DBI.dll' C:\strawberry-perl\dmake\bin\dmake.EXE -- NOT OK #-------------- Template::Toolkit --------------# C:\strawberry-perl\perl\bin\perl.exe -MExtUtils::Mksymlists \ -e "Mksymlists('NAME'=>\"Template::Stash::XS\", 'DLBASE' => 'XS', + 'DL_FUNCS' => { }, 'FUNCLIST' => [], 'IMPORTS' = > { }, 'DL_VARS' => []);" dlltool --def XS.def --output-exp dll.exp dlltool: _spawnvp dmake: Error code 129, while making '..\blib\arch\auto\Template\Stash +\XS\XS.dll' dmake.EXE: Error code 255, while making 'subdirs' C:\strawberry-perl\dmake\bin\dmake.EXE -- NOT OK

i've tried installing DBI, Template::Toolkit , Date::Calc but they all failed with error code 129 from dmake after trying to link the dynamic libraries (DLLs) with dlltool.

i also have Active Perl 5.8.8.819 (MSWin32-x86-267479) installed and the mentioned XS modules as PPM, so i know they must compile on Windows... somehow. i'm using Windows XP SP2.

this might not be the best place to post about my problem (i know about the RT bug queue for strawberry-perl), but i think i'm missing something obvious here and it might not be a bug in strawberry-perl. i'll surely appreciate any help or suggestion. thank you for your time.

:)))))

Replies are listed 'Best First'.
Re: Error compiling XS code with strawberry-perl 5.8.8-alpha-2
by asz (Pilgrim) on Oct 17, 2006 at 13:26 UTC

    i found the problem! having installed/uninstalled strawberry-perl several times, i had multiple entries in %PATH%, here is how it looked (the relevant snippet):

    [...] C:\strawberry-perl\perl\bin;C:\strawberry-perl\dmake\bin;C:\strawberry +-perl\mingw\bin; C:\strawberry-perl\perl\bin;C:\strawberry-perl\dmake\bin;C:\strawberry +-perl\mingw\bin; C:\strawberry-perl\perl\bin;C:\strawberry-perl\dmake\bin;C:\strawberry +-perl\mingw\bin; [...]

    it didn't occurred to me to look a the environmental variables of Windows, only after i discovered that running the failing command by hand, with the full path to dlltool, that command didn't fail. i don't understand exactly what happened, but those multiple entries in %PATH% confused the heck out of dlltool and made it "run in circles" :)

    well it certainly seems there's a bug in how strawberry-perl manipulates environment variables and i plan to file a bug report about that. i am not complaining about it because i'm aware that that's what someone gets for playing with beta quality (read cutting edge) :)

    sorry if i wasted anyones time with this.

    :)))))
      beta quality

      s/beta/alpha/

      Environment manipulation on install/uninstall leaves a lot to be desired, still. It's the top entry on the Vanilla Perl Feature Backlog.

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

      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

        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

        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.

        Don't copy/paste files, modify your %PATH%, %INCLUDE% ... on the other hand, install a stable release (vanilla, not strawberry).
Re: Error compiling XS code with strawberry-perl 5.8.8-alpha-2
by xdg (Monsignor) on Oct 17, 2006 at 13:12 UTC

    Those have worked for many of us with Strawberry Perl, so I wonder if you're experiencing some unexpected conflict with ActiveState. Some questions that might help us diagnose the issue:

    • Which perl is first in your $ENV{PATH}?

    • What do you get if you run "dlltool -V"?

    • Do other XS modules compile OK or is it just DBI and Template Toolkit that have problems? (Try Time::Piece)

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

      actually ActiveState's Perl version was first in my %PATH%, but Strawberry Perl can happily coexist with that, provided that you run perl with the full path to the executable. please read about the details in my other post.

      certainly something that i would like to test is making binary PPD files with Strawberry Perl, perhaps using something like PPM::Make from CPAN. this would be beneficial for those (let say less experienced) users that are more confortable running ActiveState Perl with binary distributions than compiling modules from source, and lets face it there are some hard to compile modules, like those that require external libraries, not to mention failing tests, etc. - you get my point. like others i think there's a "market" for both Perl distributions :)

      anyway where is the best place to discuss something like this? the page from RT, the wiki? as far as i know there is no mailing-list related to Strawberry/Vanilla Perl...
      UPDATE: sometimes i'm too lazy to even read! there is good information about this on the Win32 Perl Wiki.

      thank you xdg for taking the time to answer this and for giving us this magnificent distribution.

      :)))))