in reply to Re: XS build error
in thread XS build error

Or maybe it came from using mingw with a Perl built with MS's compiler

Yes, that appears to be the trouble - though, assuming that the op is using a recent build of ActivePerl (which appears to be the case), there should be no such problem when using MinGW.

The specific problem I notice in the output provided by the op is that "-out:" is a VC++ flag. The comparable flag for MinGW is "-o". When MinGW sees -out:some_file, instead of trying to write to some_file, it tries to write to ut:some_file which, of course, is not a valid path.

I don't know why it is that the op is getting that VC++ flag. It looks like the fact that MinGW is in use is being overlooked somewhere along the way - possibly in ExtUtils::MM_Win32.

It may help us if we could see the output of perl -V (that's an upper case "V"), and if we also knew the version of ExtUtils::MakeMaker that's installed on that perl. (For the latter, run perl -MExtUtils::MakeMaker -e "print $ExtUtils::MakeMaker::VERSION")

Cheers,
Rob

Replies are listed 'Best First'.
Re^3: XS build error
by ikegami (Patriarch) on Jan 05, 2010 at 01:41 UTC

    I was thinking it would get some args from Config, but I really don't know much about that. I have ActivePerl (built using MS compiler) and an MS compiler.

      I was thinking it would get some args from Config

      That was my first thought, too, but I couldn't find any instances of -out in either Config.pm or Config_heavy.pl.

      I did find this, however, in ExtUtils::MM_Win32:
      push(@m, q{ $(LD) -out:$@ $(LDDLFLAGS) }.$ldfrom.q{ $(OTHERLDFLAGS) } .q{$(MYEXTLIB) $(PERL_ARCHIVE) $(LDLOADLIBS) -def:$(EXPORT_LIST) +});
      and wondered whether that might be where the botch up occurs. With MinGW, $(LD) will be g++ (so that part fits with what we're seeing from the op), but I'm not sure what's contained in the other symbols and haven't checked. In any case, that code comes from a block that should only be entered if 'cl' is the compiler.

      There was a significant change from perl 5.10.0 to 5.10.1 on windows regarding $Config{cc}. With the former it was just plain old 'gcc' or 'cl' (or whatever), but with the latter it becomes 'X:/full/path/to/Y.exe' (where 'X' is the drive letter, and 'Y' is the name of the compiler.)
      This meant that, in EU::MM_Win32:
      my $GCC = 1 if $Config{'cc'} =~ /^gcc/i;
      had to be changed to:
      my $GCC = $Config{'cc'} =~ /\bgcc/i ? 1 : 0;
      I don't quite see how all this fits in with the op's problem (and probably never will without perl -V and the version of EU::MM), but it looks a bit supicious.

      Cheers,
      Rob
Re^3: XS build error
by pvizeli (Initiate) on Jan 07, 2010 at 07:30 UTC

    Your comment are very plausible. Sorry for my late answer but I had flu the last 2 days and was in my bed :/

    Normaly I use perl on my FreeBSD computers, windows are also virgin territory for me. Here is the output of your commands:

    C:\Dokumente und Einstellungen\Administrator\Desktop\test>perl -V Set up gcc environment - 3.4.5 (mingw-vista special r3) Summary of my perl5 (revision 5 version 10 subversion 1) configuration +: Platform: osname=MSWin32, osvers=5.00, archname=MSWin32-x86-multi-thread uname='' config_args='undef' hint=recommended, useposix=true, d_sigaction=undef useithreads=define, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=und +ef use64bitint=undef, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='C:/Perl/site/bin/gcc.exe', ccflags ='-DNDEBUG -DWIN32 -D_CONSO +LE -DNO_ST RICT -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE -DPRIVLIB_LAST_IN_INC -DPER +L_IMPLICIT _CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX -DHASA +TTRIBUTE - fno-strict-aliasing -mms-bitfields', optimize='-O2', cppflags='-DWIN32' ccversion='', gccversion='3.4.5 (mingw-vista special r3)', gccosan +dvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=8 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64 +', lseeksi ze=8 alignbytes=8, prototype=define Linker and Libraries: ld='C:\Perl\site\bin\g++.exe', ldflags ='-L"C:\Perl\lib\CORE"' libpth=\lib libs=-lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 +-lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion +-lodbc32 - lodbccp32 -lmsvcrt perllibs=-lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvap +i32 -lshel l32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lvers +ion -lodbc 32 -lodbccp32 -lmsvcrt libc=msvcrt.lib, so=dll, useshrplib=true, libperl=perl510.lib gnulibc_version='' Dynamic Linking: dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-mdll -L"C:\Perl\lib\CORE"' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS PERL_MALLOC_WRAP PL_OP_SLAB_ALLOC USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_SITECUSTOMIZE Locally applied patches: ActivePerl Build 1006 [291086] 32728 64-bit fix for Time::Local Built under MSWin32 Compiled at Aug 24 2009 13:48:26 @INC: C:/Perl/site/lib C:/Perl/lib . C:\Dokumente und Einstellungen\Administrator\Desktop\test>
    C:\Dokumente und Einstellungen\Administrator>perl -MExtUtils::MakeMake +r -e "prin t $ExtUtils::MakeMaker::VERSION" Set up gcc environment - 3.4.5 (mingw-vista special r3) 6.56 C:\Dokumente und Einstellungen\Administrator>

    I'll test a work around with manual change the Makefile, but this is only temporary. Can I install the VC and MakeMaker try to use it without any config changes?

    best regards, Pascal Vizeli

      Using ExtUtils::MakeMaker 6.56, I get the same results as you. When I still had 6.55_02, I got past linking to the original problem you had:
      C:\stager2\Zmodem>perl Makefile.PL Set up gcc environment - 3.4.5 (mingw-vista special r3) Checking if your kit is complete... Looks good Writing Makefile for Device::Modem::Protocol::Zmodem C:\stager2\Zmodem>dmake cp lib/Zmodem.pm blib\lib\Zmodem.pm C:\progs\perl5101\bin\perl.exe C:\Progs\perl5101\lib\ExtUtils\xsubpp +-typemap C:\progs\perl5101\lib\ExtUtils\typemap Zmodem.xs > Zmodem.x +sc && C:\progs\perl5101\bin\perl.exe -MExtUtils::Command -e "mv" -- Z +modem.xsc Zmodem.c Please specify prototyping behavior for Zmodem.xs (see perlxs manual) c:/progs/perl5101/site/bin/gcc.exe -c -DNDEBUG -DWIN32 -D_CO +NSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE -DPRIVLIB_LAS +T_IN_INC -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DP +ERL_MSVCRT_READFIX -DHASATTRIBUTE -fno-strict-aliasing -mms-bitfields + -O2 -DVERSION=\"0.01\" -DXS_VERSION=\"0.01\" "-IC:\progs +\perl5101\lib\CORE" Zmodem.c Running Mkbootstrap for Device::Modem::Protocol::Zmodem () C:\progs\perl5101\bin\perl.exe -MExtUtils::Command -e "chmod" -- 644 Z +modem.bs C:\progs\perl5101\bin\perl.exe -MExtUtils::Mksymlists \ -e "Mksymlists('NAME'=>\"Device::Modem::Protocol::Zmodem\", 'DLBA +SE' => 'Zmodem', 'DL_FUNCS' => { }, 'FUNCLIST' => [], 'IMPORTS' => { + }, 'DL_VARS' => []);" Set up gcc environment - 3.4.5 (mingw-vista special r3) dlltool --def Zmodem.def --output-exp dll.exp c:\progs\perl5101\site\bin\g++.exe -o blib\arch\auto\Device\Modem\Prot +ocol\Zmodem\Zmodem.dll -Wl,--base-file -Wl,dll.base -mdll -L"C:\progs +\perl5101\lib\CORE" Zmodem.o -Wl,--image-base,0x3f000000 C:\progs\pe +rl5101\lib\CORE\perl510.lib -lkernel32 -luser32 -lgdi32 -lwinspool -l +comdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -l +ws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lmsvcrt dll.exp dll.exp:fake:(.edata+0x34): undefined reference to `boot_Device__Modem +__Protocol__Zmodem' dll.exp:fake:(.edata+0x38): undefined reference to `boot_Device__Modem +__Protocol__Zmodem' collect2: ld returned 1 exit status dmake.exe: Error code 129, while making 'blib\arch\auto\Device\Modem\ +Protocol\Zmodem\Zmodem.dll'

      Try

      cpan M/MS/MSCHWERN/ExtUtils-MakeMaker-6.55_02.tar.gz

      Update: It seems I missed that this was already discovered

      You have EU-MM-6.56, which is not the version of EU::MM that shipped with your ActivePerl. Sure enough, if I update EU::MM to version 6.56 on AS build 1006 (which is the same build of perl as you have) I get the same error as you.

      Simplest way to fix this would be to resort to the original version of EU::MM that shipped with build 1006 - and the easiest way to do that would be to just re-install ActivePerl "on top of" the existing perl installation.
      Then check that the version you have is reported as "6.55_02" (which, I think, might be different to the version 6.55_02 that's on CPAN). If it still reports 6.56, then we have to try and work out where that version 6.56 is located, and why it is being found instead of the version that ships with ActivePerl.

      Cheers,
      Rob

        Yes, that works fine. But now I've the first error. Is it link error while it use the false linker from VC?

        Set up gcc environment - 3.4.5 (mingw-vista special r3) dlltool --def Zmodem.def --output-exp dll.exp C:\Perl\site\bin\g++.exe -o blib\arch\auto\Device\Modem\Protocol\Zmode +m\Zmodem.d ll -Wl,--base-file -Wl,dll.base -mdll -L"C:\Perl\lib\CORE" Zmodem.o -W +l,--image- base,0x3f000000 C:\Perl\lib\CORE\perl510.lib -lkernel32 -luser32 -lgd +i32 -lwins pool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -lu +uid -lws2_ 32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lmsvcrt dll.exp dll.exp:fake:(.edata+0x34): undefined reference to `boot_Device__Modem +__Protocol __Zmodem' dll.exp:fake:(.edata+0x38): undefined reference to `boot_Device__Modem +__Protocol __Zmodem' collect2: ld returned 1 exit status dmake.exe: Error code 129, while making 'blib\arch\auto\Device\Modem\ +Protocol\Z modem\Zmodem.dll'