zlib icon indicating copy to clipboard operation
zlib copied to clipboard

crc32 functions produce errors when building 1.2.12 zlibstat on Windows

Open SLDiggie opened this issue 3 years ago • 7 comments

zlib 1.2.12 fails to build as 32-bit with the following:

1>------ Build started: Project: zlibstat, Configuration: ReleaseWithoutAsm Win32 ------ 1>crc32.c 1>c:\zlib\dist\crc32.c(1089): error C2708: 'crc32_combine64': actual parameters length in bytes differs from previous call or reference 1>c:\zlib\dist\crc32.c(1072): note: see declaration of 'crc32_combine64' 1>c:\zlib\dist\crc32.c(1106): error C2708: 'crc32_combine_gen64': actual parameters length in bytes differs from previous call or reference 1>c:\zlib\dist\crc32.c(1093): note: see declaration of 'crc32_combine_gen64' 1>c:\zlib\dist\crc32.c(1110): error C2373: 'crc32_combine_op': redefinition; different type modifiers 1>c:\zlib\dist\zlib.h(1768): note: see declaration of 'crc32_combine_op' 1>Done building project "zlibstat.vcxproj" -- FAILED. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

It builds without these errors when building as 64-bit. Was using VS2017.

SLDiggie avatar Mar 30 '22 21:03 SLDiggie

I am facing the same problem, also using VS2017. In addition, to make the x64 build create a library successfully, I had to remove the references to inffas8664.c (which obviously does not exist anymore) and gvmat64.obj and inffasx64.obj from zlibstat.vcxproj. I am getting the impression that for release 1.2.12, which everyone should upgrade to, the VC contrib files have not received much love.

skuskusku avatar Mar 31 '22 08:03 skuskusku

Same here, but defining Z_LARGE64 as preprocessor definition works for me. I was using VS2010 (from contrib/vstudio/vc10).

tbeu avatar Apr 02 '22 13:04 tbeu

c:\zlib\dist\crc32.c(1110): error C2373: 'crc32_combine_op': redefinition; different type modifiers

That problem can probably be solved by adding "ZEXPORT" to the function crc32_combine_op() in crc32.c

mkauf avatar Apr 07 '22 06:04 mkauf

c:\zlib\dist\crc32.c(1110): error C2373: 'crc32_combine_op': redefinition; different type modifiers

That problem can probably be solved by adding "ZEXPORT" to the function crc32_combine_op() in crc32.c

after adding "ZEXPORT" . i am able to fix but still one issue Severity Code Description Project File Line Suppression State Error C2708 'crc32_combine64': actual parameters length in bytes differs from previous call or reference zlibvc C:\Users\zlib-1.2.12\crc32.c 1091 Error C2708 'crc32_combine_gen64': actual parameters length in bytes differs from previous call or reference zlibvc C:\Users\zlib-1.2.12\crc32.c 1108

PCIIT avatar Apr 08 '22 04:04 PCIIT

after adding "ZEXPORT" . i am able to fix but still one issue

That was my obersavation, too and was the reason why I did not recommend it, but rather Z_LARGE64.

tbeu avatar Apr 08 '22 12:04 tbeu

Hi , i am trying to build for win32 but it is failure due to below error Severity Code Description Project File Line Suppression State Warning C4067 unexpected tokens following preprocessor directive - expected a newline zlibvc
C:\Users\zlib-1.2.12_latest\zlib-1.2.12\contrib\minizip\iowin32.c 31 Warning C4244 '=': conversion from 'ush' to 'uchf', possible loss of data zlibvc C:\Users\zlib-1.2.12_latest\zlib-1.2.12\deflate.c 1916 Warning C4244 '=': conversion from 'ush' to 'uchf', possible loss of data zlibvc C:\Users\zlib-1.2.12_latest\zlib-1.2.12\deflate.c 2041 Warning C4244 '=': conversion from 'ush' to 'uchf', possible loss of data zlibvc
C:\Users\zlib-1.2.12_latest\zlib-1.2.12\deflate.c 2150

PCIIT avatar Apr 10 '22 18:04 PCIIT

update crc32.c uLong ZEXPORT crc32_combine_gen(len2) z_off_t len2; { return crc32_combine_gen64((z_off64_t)len2); // convert type to z_off64_t }

uLong ZEXPORT crc32_combine(crc1, crc2, len2) uLong crc1; uLong crc2; z_off_t len2; { return crc32_combine64(crc1, crc2, (z_off64_t)len2); // convert type to z_off64_t }

TatianaVV avatar Jun 24 '22 08:06 TatianaVV

Resolved by 7ecf7c7458578d05a20fa481436dd5c58db112f7 and 6c532a8e8a2fcedc4abbe2378dd26b5d89cf1c4a.

tbeu avatar Sep 05 '22 19:09 tbeu

Per @tbeu 's assertion, I will close this issue.

madler avatar Oct 06 '22 20:10 madler