Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^5: unable to install Audio::Scan module from cpan

by syphilis (Archbishop)
on Jul 16, 2017 at 11:53 UTC ( [id://1195206]=note: print w/replies, xml ) Need Help??


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

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

Replies are listed 'Best First'.
Re^6: unable to install Audio::Scan module from cpan
by vamank (Initiate) on Jul 20, 2017 at 07:55 UTC

    the first patch u gave me said,

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

    but my scan.xs contained,

    // Headers for stat support #ifndef _MSC_VER # include <windows.h> ---

    so i have just replaced _MSC_VER with __WIN32__ at whatever files and locations you mentioned in that patch. Gave the previous output "Scan.o:Scan.c:(.text+0x8d00): undefined reference to `uncompress'" and ending up in fatal error as mentioned in above mails.

    Now regarding this reply:

    I downloaded zlib and unzipped it at "C:\vaman\zlib-1.2.8" (vaman directory also has audio scan project @C:\vaman\Audio-Scan-0.98). I executed this: C:\vaman\zlib-1.2.8\zlib-1.2.8>mingw32-make -f win32/Makefile.gcc as you said above. The generated libz.a i moved to the following location.

    @Enter perl -V:libpth :

    It gave libpth='C:\MinGW\i686-w64-mingw32\lib. So i moved libz.a to the above location.

    But still it does not get thru successfully.

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

    Tried with dmake, but it was just to find the same issue again.

      Does it work if you run nmake realclean and then start all over again from the beginning ?
      If it still doesn't work then I need to see the output of the first step (ie when the Makefile.PL gets run).

      Cheers,
      Rob

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1195206]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2024-04-25 20:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found