Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Windows library errors

by nglenn (Beadle)
on Aug 12, 2012 at 19:09 UTC ( #986975=perlquestion: print w/replies, xml ) Need Help??
nglenn has asked for the wisdom of the Perl Monks concerning the following question:

I'm running Windows x64 and am annoyed that some important modules won't install. There seems to be something wrong some binary part of my installation. For example, I see on the CPAN testers website that Data::UUID installs fine on Windows. But when I try to install it, I get a really long list of errors like this:

UUID.o:UUID.c:(.text+0x1eac): undefined reference to `_imp__Perl_croak +_xs_usage' UUID.o:UUID.c:(.text+0x1eb9): undefined reference to `_imp__Perl_get_c +ontext' UUID.o:UUID.c:(.text+0x1f33): undefined reference to `_imp__Perl_sv_de +rived_from' UUID.o:UUID.c:(.text+0x1f72): undefined reference to `_imp__Perl_sv_2i +v_flags' UUID.o:UUID.c:(.text+0x2217): undefined reference to `_imp__Perl_croak +_nocontext' UUID.o:UUID.c:(.text+0x222e): undefined reference to `_imp__Perl_croak +_xs_usage' ...

I believe that Moose::Autobox should work, too; but when I try to install it I get this:

# Tried to use 'Moose::Autobox'. # Error: Can't load 'C:/strawberry/perl/lib/auto/autobox/autobox. +dll' for module autobox: load_file:%1 is not a valid Win32 applicatio +n at C:/strawberry/perl/lib/ line 68.

I am using Perl 5.16.1 (Strawberry); but I just installed it over a version 5.12.x that was having the same problems. I'm not sure if it maters, but I have another version of gcc on my system besides the one that came with perl:

C:\Users\Nate Glenn>where gcc C:\dev\MinGW\bin\gcc.exe C:\strawberry\c\bin\gcc.exe

Does anyone have any ideas about how I can fix this?

Replies are listed 'Best First'.
Re: Windows library errors
by bulk88 (Priest) on Aug 12, 2012 at 20:21 UTC
    You dont have libperl51*.a in your library search path. Your file is probably broken or from a different perl version. You said you installed "over", thats a disaster. XS libraries can only be used within the same minor (middle number) version. You can NOT under any circumstance use a XS module compiled with 5.12 on 5.14 or a XS module compiled with 5.14 on 5.12 Perl. Or a 5.12 XS module with a 5.10 or 5.16 Perl. You can use an XS module compiled with Perl 5.12.3 with Perl 5.12.1 at runtime or any other permutation aslong as the first and 2nd numbers match. The last number can change, but Perl guarantees ABI between maintenance releases.

    # Tried to use 'Moose::Autobox'. # Error: Can't load 'C:/strawberry/perl/lib/auto/autobox/autobox. +dll' for module autobox: load_file:%1 is not a valid Win32 applicatio +n at C:/strawberry/perl/lib/ line 68.
    means the Windows DLL loader couldn't load the DLL, one reason is an unresolved function import. It probably couldn't find its parent perl dll or the parent perl dll didn't export a function this XS DLL wants.

    Cross GCC version ABI and which GCC MakeMaker uses I dont know enough to answer.

    You will atleast have to delete, the CORE folder, all .lib/.a files, and all .dll files, and /bin (where perl.exe is), in your perl installation if you want to install over, and delete /lib and /vendor for safety. /site is the only folder you can keep (but make sure no .dlls are inside), even this can cause problems sometimes (a newer dual life was installed in /site than original perl /lib has, then you install a newer perl, that has a newer dual life in /lib than in /site, but Perl will load the older than stock dual life from /site since /site has precedence over /lib). All XS modules have to be recompiled, no exceptions. Pure perl, extremely unlikely, (I've never heard of a CPAN module that does Perl code generation or .pm renaming at build/install time based on Perl version).
      Thanks! Solved it all. May I ask what ABI stands for?
Re: Windows library errors
by ig (Vicar) on Aug 12, 2012 at 20:03 UTC

    I'm running Strawberry perl 5.12.3 on Windows 7 64bit and have installed Data::UUID successfully. I have also installed Data::UUID on previous versions of perl and other versions of Windows, both 32 and 64 bits.

    I would remove then re-install perl and see if that fixes the problem. If not, then fix PATH to ensure that while installing modules to perl, only the build tools (gcc, etc.) from the perl distribution are in the path.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://986975]
Approved by Corion
[shmem]: use parens to group expressions
[shmem]: you can't use next in a statement modifier
[shmem]: next requires a BLOCK

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2018-05-20 18:44 GMT
Find Nodes?
    Voting Booth?