in reply to Re: unable to install Audio::Scan module from cpan
in thread unable to install Audio::Scan module from cpan

dmake also ends in a pretty similar fashion in the following way:

win32/zlib.lib(./Win32_LIB_Release/crc32.obj):(.text$mn+0x22): undefin +ed reference to `@__security_check_cookie@4' win32/zlib.lib(./Win32_LIB_Release/crc32.obj):(.text$mn+0x1be): undefi +ned reference to `@__security_check_cookie@4' c:/perl/site/lib/auto/mingw/bin/../lib/gcc/i686-w64-mingw32/4.6.3/../. +./../../i686-w64-mingw32/bin/ld.exe: win32/zlib.lib(./Win32_LIB_Relea +se/crc32.obj): bad reloc address 0x1be in section `.text$mn' c:/perl/site/lib/auto/mingw/bin/../lib/gcc/i686-w64-mingw32/4.6.3/../. +./../../i686-w64-mingw32/bin/ld.exe: final link failed: Invalid opera +tion collect2: ld returned 1 exit status dmake.exe: Error code 129, while making 'blib\arch\auto\Audio\Scan\Sc +an.dll'

When i went to scan folder, there is no scan.dll present inside.

I did a little google search, it says this arise when i have both active and strawberry perl installed. But i have only active perl installed.

Replies are listed 'Best First'.
Re^3: unable to install Audio::Scan module from cpan
by syphilis (Archbishop) on Jul 12, 2017 at 13:47 UTC
    I've just checked with my Strawberry Perl (perl 5, version 18, subversion 2 (v5.18.2) built for MSWin32-x64-multi-thread), using the following patch to the 3 files (specified in the bug report):
    --- ../Audio-Scan-0.98-1/Scan.xs 2017-07-12 23:26:41 +1000 +++ Scan.xs 2017-07-12 23:25:17 +1000 @@ -12,7 +12,7 @@ #endif // Headers for stat support -#ifdef _MSC_VER +#ifdef __WIN32__ # include <windows.h> #else # include <sys/stat.h> @@ -185,7 +185,7 @@ uint64_t size = 0; uint32_t hash; -#ifdef _MSC_VER +#ifdef __WIN32__ BOOL fOk; WIN32_FILE_ATTRIBUTE_DATA fileInfo; --- ../Audio-Scan-0.98-1/include/common.h 2017-07-12 23:26:52 +1000 +++ include/common.h 2017-07-12 23:24:48 +1000 @@ -33,7 +33,7 @@ #define DEFAULT_BLOCK_SIZE 4096 -#ifndef _MSC_VER +#ifndef __WIN32__ // We use the built-in GUID type on Windows typedef struct _GUID { uint32_t Data1; --- ../Audio-Scan-0.98-1/src/common.c 2017-07-12 23:27:09 +1000 +++ src/common.c 2017-07-12 23:24:10 +1000 @@ -205,7 +205,7 @@ off_t _file_size(PerlIO *infile) { -#ifdef _MSC_VER +#ifdef __WIN32__ // Win32 doesn't work right with fstat off_t file_size;
    Works fine for me.
    And it should work fine with any ActiveState Perl for which 'perl-V:cc' reports that 'cc' is 'gcc'.

    I must say that I find it exceedingly annoying that the author has done nothing to remove the need for this patching.
    Audio-Scan-0.98 was released just 3 months ago, though the bug report was filed over 5 years ago !!

    Cheers,
    Rob

      I must say that I find it exceedingly annoying that the author has done nothing to remove the need for this patching. Audio-Scan-0.98 was released just 3 months ago, though the bug report was filed over 5 years ago !!

      Annoying traditions have traditional solutions

      tried the above patch @syphilis. It still doesnt work. I am using active perl. Following is what i am getting still:

      C:\vaman\Audio-Scan-0.98\Audio-Scan-0.98>nmake Microsoft (R) Program Maintenance Utility Version 12.00.21005.1 Copyright (C) Microsoft Corporation. All rights reserved. Skip blib\lib\Audio\Scan.pm (unchanged) Running Mkbootstrap for Audio::Scan () C:\Perl\bin\perl.exe -MExtUtils::Command -e chmod -- 644 Scan. +bs C:\Perl\bin\perl.exe C:\Perl\lib\ExtUtils\xsubpp -typemap C:\ +Perl\lib\ExtUtils\typemap Scan.xs > Scan.xsc && C:\Perl\bin\perl.exe + -MExtUtils::Command -e mv -- Scan.xsc Scan.c Please specify prototyping behavior for Scan.xs (see perlxs manual) gcc -c -Iinclude -Isrc -s -O2 -DWIN32 -DPERL_TEXTMODE_SCRIPT +S -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DU +SE_PERLIO -fno-strict-aliasing -mms-bitfields -s -O2 -DVERSION=\"0 +.98\" -DXS_VERSION=\"0.98\" "-IC:\Perl\lib\CORE" Scan.c In file included from src/common.c:17:0, from Scan.xs:21: include/common.h:49:16: error: redefinition of 'struct _GUID' c:\perl\site\lib\auto\mingw\bin\../lib/gcc/i686-w64-mingw32/4.6.3/../. +./../../i686-w64-mingw32/include/guiddef.h:8:16: note: originally def +ined here include/common.h:54:11: error: conflicting types for 'GUID' c:\perl\site\lib\auto\mingw\bin\../lib/gcc/i686-w64-mingw32/4.6.3/../. +./../../i686-w64-mingw32/include/guiddef.h:13:3: note: previous decla +ration of 'GUID' was here In file included from src/common.c:18:0, from Scan.xs:21: src/buffer.c:798:1: error: conflicting types for 'buffer_get_guid' include/buffer.h:106:6: note: previous declaration of 'buffer_get_guid +' was here In file included from src/asf.c:42:0, from Scan.xs:26: include/asf.h:30:0: warning: "IsEqualGUID" redefined [enabled by defau +lt] c:\perl\site\lib\auto\mingw\bin\../lib/gcc/i686-w64-mingw32/4.6.3/../. +./../../i686-w64-mingw32/include/guiddef.h:145:0: note: this is the l +ocation of the previous definition NMAKE : fatal error U1077: 'C:\Perl\site\bin\gcc.EXE' : return code '0 +x1' stop.

      The error it gives is redefinition of 'struct _GUID'. It is present in \include\common.c of AudioScan project as well as in compiler at C:\Perl\site\lib\auto\MinGW\i686-w64-mingw32\include\guiddef.h.

      What do i do next.

      Just for a try, i commented 'struct_GUID' from common.h. It gave the following error:

      C:\vaman\Audio-Scan-0.98\Audio-Scan-0.98>nmake Microsoft (R) Program Maintenance Utility Version 12.00.21005.1 Copyright (C) Microsoft Corporation. All rights reserved. C:\Perl\bin\perl.exe C:\Perl\lib\ExtUtils\xsubpp -typemap C:\ +Perl\lib\ExtUtils\typemap Scan.xs > Scan.xsc && C:\Perl\bin\perl.exe + -MExtUtils::Command -e mv -- Scan.xsc Scan.c Please specify prototyping behavior for Scan.xs (see perlxs manual) gcc -c -Iinclude -Isrc -s -O2 -DWIN32 -DPERL_TEXTMODE_SCRIPT +S -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DU +SE_PERLIO -fno-strict-aliasing -mms-bitfields -s -O2 -DVERSION=\"0 +.98\" -DXS_VERSION=\"0.98\" "-IC:\Perl\lib\CORE" Scan.c In file included from src/asf.c:42:0, from Scan.xs:26: include/asf.h:30:0: warning: "IsEqualGUID" redefined [enabled by defau +lt] c:\perl\site\lib\auto\mingw\bin\../lib/gcc/i686-w64-mingw32/4.6.3/../. +./../../i686-w64-mingw32/include/guiddef.h:145:0: note: this is the l +ocation of the previous definition C:\Perl\bin\perl.exe -MExtUtils::Mksymlists -e "Mksymlists('N +AME'=>\"Audio::Scan\", 'DLBASE' => 'Scan', 'DL_FUNCS' => { }, 'FUNCL +IST' => [], 'IMPORTS' => { }, 'DL_VARS' => []);" dlltool --def Scan.def --output-exp dll.exp g++ -o blib\arch\auto\Audio\Scan\Scan.dll -Wl,--base-file -Wl, +dll.base -mdll -s -static-libgcc -static-libstdc++ -L"C:\Perl\lib\COR +E" -L"C:\MinGW\i686-w64-mingw32\lib" Scan.o C:\Perl\lib\CORE\libper +l518.a -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 - +ladvapi32 -lshell32 -lo le32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lo +dbc32 -lodbccp32 -lcomctl32 dll.exp Scan.o:Scan.c:(.text+0x8d00): undefined reference to `uncompress' Scan.o:Scan.c:(.text+0x950e): undefined reference to `uncompress' c:/perl/site/lib/auto/mingw/bin/../lib/gcc/i686-w64-mingw32/4.6.3/../. +./../../i686-w64-mingw32/bin/ld.exe: Scan.o: bad reloc address 0x0 in + section `.data' c:/perl/site/lib/auto/mingw/bin/../lib/gcc/i686-w64-mingw32/4.6.3/../. +./../../i686-w64-mingw32/bin/ld.exe: final link failed: Invalid opera +tion collect2: ld returned 1 exit status NMAKE : fatal error U1077: 'C:\Perl\site\bin\g++.EXE' : return code '0 +x1' Stop.

      Also, the readmewin32 file of Audio-scan-.98 says:

      "nmake -f win32/Makefile.msc Copy zlib.lib, zlib.h, zconf.h into the Audio::Scan win32 directory (o +verwriting latter two files)".

      I downloaded audioscan.98.tar multiple times from cpan. After extract the project doesn't have any win32 folder. I want to install any working version of audio scan urgently.

      Thanks in advance.

        The error it gives is redefinition of 'struct _GUID'. It is present in \include\common.c of AudioScan project as well as in compiler at ...

        I see it in include/common.h:
        #ifndef __WIN32__ // We use the built-in GUID type on Windows typedef struct _GUID { uint32_t Data1; uint16_t Data2; uint16_t Data3; uint8_t Data4[8]; } _PACKED GUID; #endif
        However, the C pre-processor will remove that code because __WIN32__ is defined (and hence violates the "#ifndef __WIN32__" condition).
        In other words, it should not be necessary to comment out that section of code in common.h, and commenting out that code should make no difference.
        Did you perhaps incorrectly replace "#ifndef _MSC_VER" with "#ifdef __WIN32__" ?

        Scan.o:Scan.c:(.text+0x8d00): undefined reference to `uncompress'

        This happens because you need to link to libz. It seems the link has been removed - probably by the 'perl Makefile.PL' step because libz.a could not be found.
        To install libz, download the libz source, unzip it, then cd to the top level folder and run:
        mingw32-make -f win32/Makefile.gcc
        (The Audio::Scan source does not contain a win32 folder - but the libz source does.)
        Then copy the generated libz.a to one of your $Config{libpth} directories. Enter perl -V:libpth to see where those directories are.
        Your using a mingw compiler (not a micrsoft one), so you don't build libz with 'nmake', and you don't use Makefile.msc.

        Cheers,
        Rob
        I want to install any working version of audio scan urgently

        I've just uploaded a ppm package for it.
        You can either add http://www.sisyphusion.tk/ppm to your ppm repo list and then run:
        ppm install Audio::Scan --force
        or you could run the following 2 ppm commands in the given order:
        ppm install http://www.sisyphusion.tk/ppm/PPM-Sisyphusion.ppd --force ppm install http://www.sisyphusion.tk/ppm/Audio-Scan.ppd --force
        (The "--force" might not be needed, but it won't do any harm.)

        Tonight, I'll try to work out how you can successfully build (from source) the module on your ActivePerl.

        Cheers,
        Rob