gdraheim / zziplib

The ZZIPlib provides read access on ZIP-archives and unpacked data. It features an additional simplified API following the standard Posix API for file access
Other
60 stars 50 forks source link

Missing defines when compiling wtih MSVC #157

Open wolfv opened 4 months ago

wolfv commented 4 months ago

I got some errors like in the following pipeline: https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=888498&view=logs&jobId=a70f640f-cc53-5cd3-6cdc-236a1aa90802&j=a70f640f-cc53-5cd3-6cdc-236a1aa90802&t=6119ccbe-9301-594f-7c27-f792b80a7fcc

Maybe someone has ideas?

[20/56] Building C object bins\CMakeFiles\zzcat.dir\zzcat.c.obj
FAILED: bins/CMakeFiles/zzcat.dir/zzcat.c.obj 
C:\PROGRA~1\MICROS~2\2022\ENTERP~1\VC\Tools\MSVC\1429~1.301\bin\HostX64\x64\cl.exe    -I%SRC_DIR% -I%SRC_DIR%\build -I%SRC_DIR%\bins -external:I%PREFIX%\Library\include -external:W0 /DWIN32 /D_WINDOWS /W3 /MD /O2 /Ob2 /DNDEBUG /showIncludes /Fobins\CMakeFiles\zzcat.dir\zzcat.c.obj /Fdbins\CMakeFiles\zzcat.dir\ /FS -c %SRC_DIR%\bins\zzcat.c
Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30154 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

%SRC_DIR%\bins\zzcat.c(35): error C2146: syntax error: missing ')' before identifier 'ZZIP_PACKAGE_NAME'
%SRC_DIR%\bins\zzcat.c(35): error C2059: syntax error: ')'
[21/56] Building C object bins\CMakeFiles\zzdir.dir\zzdir.c.obj
FAILED: bins/CMakeFiles/zzdir.dir/zzdir.c.obj 
C:\PROGRA~1\MICROS~2\2022\ENTERP~1\VC\Tools\MSVC\1429~1.301\bin\HostX64\x64\cl.exe    -I%SRC_DIR% -I%SRC_DIR%\build -I%SRC_DIR%\bins -external:I%PREFIX%\Library\include -external:W0 /DWIN32 /D_WINDOWS /W3 /MD /O2 /Ob2 /DNDEBUG /showIncludes /Fobins\CMakeFiles\zzdir.dir\zzdir.c.obj /Fdbins\CMakeFiles\zzdir.dir\ /FS -c %SRC_DIR%\bins\zzdir.c
Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30154 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

%SRC_DIR%\bins\zzdir.c(32): error C2146: syntax error: missing ')' before identifier 'ZZIP_PACKAGE_NAME'
%SRC_DIR%\bins\zzdir.c(32): error C2059: syntax error: ')'
[22/56] Linking C shared library zzipwrap\zzipwrap-0.dll
gdraheim commented 4 months ago

Wow, syntax error is bad thing. I intend to build a test scenario so that I can run the msvc myself but I did not have time for that lately.

As far as you are using cmake it would be good to test without the special header file - have a look at zzip/conf.h and disable the if-defined that includes <zzip/_msvc.h> as the cmake-provided <zzip/_config.h> should be correct. That _msvc.h is old stuff when vcproj files were created manually and the visualstudio guys needed to compile without a configure step.

Clearly PACKAGE_NAME is something out of the configure step.