in reply to install of Compress::Raw::Zlib on windows7 strawbery perl

gcc -c -I./zlib-src ... adler32.c adler32.c:12: error: expected declaration specifiers or '...' before +'__int64'

__int64 is the MSVC extension typespecifier for 64-bit integers, otherwise known by the (rather daft) nomenclature: long long

The code is (wrongly) using the compiler-predefined #define, _WIN32 to imply MSVC:

#if !defined(_WIN32) && (defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEF +ILE-0) # define z_off64_t off64_t #else # if defined(_WIN32) # define z_off64_t __int64 # else # define z_off64_t z_off_t #endif #endif

Which falls in a heap when you are uing gcc under windows.

A (minimal) fix would be to change that to be:

#if !defined(_WIN32) && (defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEF +ILE-0) # define z_off64_t off64_t #else # if defined(_MSC_VER) ### this line changed. # define z_off64_t __int64 # else # define z_off64_t z_off_t #endif #endif

You might also like to feed that back to the author.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

The start of some sanity?

Replies are listed 'Best First'.
Re^2: install of Compress::Raw::Zlib on windows7 strawbery perl
by gman (Friar) on Feb 22, 2012 at 04:23 UTC

    Thanks BrowerUk,

    That worked, well at least to the next error :).

    PS C:\strawberry\cpan\build\Compress-Raw-Zlib-2.050-j5KdF2> C:\Strawb +erry\c\bin\dmake.EXE gcc -c -I./zlib-src -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DUSE_SITECUS +TOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing -mms-bitfields -DPERL_MSVCRT_READFIX -s -O2 + -DVERSION=\"2.050\" -DXS_VERSION=\"2.050\" "-IC:\Strawberry\perl\lib\CORE" -DNO_VIZ -DZ_SOLO -DGZIP_OS_CODE=14 + -DUSE_PPPORT_H adler32.c gcc -c -I./zlib-src -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DUSE_SITECUS +TOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing -mms-bitfields -DPERL_MSVCRT_READFIX -s -O2 + -DVERSION=\"2.050\" -DXS_VERSION=\"2.050\" "-IC:\Strawberry\perl\lib\CORE" -DNO_VIZ -DZ_SOLO -DGZIP_OS_CODE=14 + -DUSE_PPPORT_H crc32.c In file included from c:\strawberry\c\bin\../lib/gcc/i686-w64-mingw32/ +4.4.3/../../../../i686-w64-mingw32/include/limits. h:6, from c:\strawberry\c\bin\../lib/gcc/i686-w64-mingw32/ +4.4.3/include-fixed/limits.h:122, from c:\strawberry\c\bin\../lib/gcc/i686-w64-mingw32/ +4.4.3/include-fixed/syslimits.h:7, from c:\strawberry\c\bin\../lib/gcc/i686-w64-mingw32/ +4.4.3/include-fixed/limits.h:11, from crc32.c:38: c:\strawberry\c\bin\../lib/gcc/i686-w64-mingw32/4.4.3/../../../../i686 +-w64-mingw32/include/_mingw.h:343: error: conflict ing types for 'ptrdiff_t' ./zlib-src/zutil.h:33: note: previous declaration of 'ptrdiff_t' was h +ere dmake.EXE: Error code 129, while making 'crc32.o' PS C:\strawberry\cpan\build\Compress-Raw-Zlib-2.050-j5KdF2>

      Try commenting out the following lines at zutil.h:31

      #ifdef Z_SOLO typedef long ptrdiff_t; /* guess -- will be caught if guess is wro +ng */ #endif

      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

      The start of some sanity?

        I noticed the same sequence of errors with 2.049, and pmqs is already working with the Zlib people on a fix.

        We are both unclear about why the ptrdiff typedef is needed, because on my attempt with MinGW gcc 4.4.3 (from Strawberry Perl), it needed to be commented out, while for Paul, the typedef was needed.

        Hopefully, we get to the bottom of this before Perl 5.16.