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

Hi monks

I'm implement a zmodem protocol for Device::Modem::Procotol::Zmodem. The CRC calculation are very special for this and I must that store to XS file.

I've done that with the officail tutorial but it dosn't work. First I've a symbol error with boot_"PERL_FUNCTION". I reinstall the perl on this Computer and now I've this error:
Set up gcc environment - 3.4.5 (mingw-vista special r3) C:\Perl\site\bin\g++.exe -out:blib\arch\auto\Device\Modem\Protocol\Zmo +dem\Zmodem .dll -mdll -L"C:\Perl\lib\CORE" Zmodem.o C:\Perl\lib\CORE\perl510.li +b -lkernel 32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 + -loleaut3 2 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp +32 -lmsvcr t -def:Zmodem.def C:\Perl\site\lib\auto\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\m +ingw32\bin \ld.exe: cannot open output file ut:blib\arch\auto\Device\Modem\Protoc +ol\Zmodem\ Zmodem.dll: Invalid argument collect2: ld returned 1 exit status dmake.exe: Error code 129, while making 'blib\arch\auto\Device\Modem\ +Protocol\Z modem\Zmodem.dll'
If I copy the project to a other computer with perl, I've the first link error. I dosn't understand why! I rewrite a lot of things but nothing want work.

Here is the code. Can a monk test it, and post witch error they have?

Thanks for support and best regards
Pascal V.

Replies are listed 'Best First'.
Re: XS build error
by ikegami (Patriarch) on Jan 04, 2010 at 15:50 UTC
    I just got that same error from Alien::wxWidgets. It was caused by it using cl as the linker instead of link. Or maybe it came from using mingw with a Perl built with MS's compiler.
      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

        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.

        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