Ok... here is the deal:

You need to go to file lib\CMakeLists.txt and add at the end (Line in black)

ADD_LIBRARY(zip SHARED ${LIBZIP_SOURCES} ${LIBZIP_EXTRA_FILES})

ADD_LIBRARY(zipstatic STATIC ${LIBZIP_SOURCES} ${LIBZIP_EXTRA_FILES})

SET_TARGET_PROPERTIES(zip PROPERTIES VERSION 3.0 SOVERSION 3 ) TARGET_LINK_LIBRARIES(zip ${ZLIB_LIBRARY})

INSTALL(TARGETS zip ARCHIVE DESTINATION lib LIBRARY DESTINATION lib)

Answer from Iron-Eagle on Stack Overflow
🌐
GitHub
github.com › ctabin › libzippp
GitHub - ctabin/libzippp: C++ wrapper for libzip · GitHub
You can either use libzippp.dll and libzippp.lib to link dynamically the library or simply use libzippp_static.lib to link it statically.
Starred by 454 users
Forked by 97 users
Languages   C++ 86.8% | CMake 5.9% | Makefile 4.5% | Batchfile 2.8%
Discussions

libzip doesn't come with static library
Hi, please consider also providing a static libzip library. It currently comes with a .dll and .dll.a (but no .a file). libzip is one of two missing dependencies that would allow us to build sigrok (see www.sigrok.org) natively on Window... More on github.com
🌐 github.com
1
August 16, 2020
Adding and deploying static *.a library. How?
Hello all! I have static library libzip.a. How to add and deploy it in Qt project and start to use it? When I am trying to compile I have this error: Undefin... More on forum.qt.io
🌐 forum.qt.io
3
0
March 1, 2019
How to use static library libzip.lib in a new DLL project
I discovered git repositories that alleviate building Dynamic and static versions of zlib and libzip: https://github.com/kiyolee/zlib-win-build... More on tek-tips.com
🌐 tek-tips.com
0
0
January 13, 2025
c - building DLL based on libzip-static.lib - Stack Overflow
I fail to link to the libzip-static.lib starting with a C++ DLL project and think that's because of the mismatch of C++ and C (zlib and libzip are C projects). More on stackoverflow.com
🌐 stackoverflow.com
🌐
GitHub
github.com › msys2 › MINGW-packages › issues › 3561
libzip doesn't come with static library · Issue #3561 · msys2/MINGW-packages
August 16, 2020 - It currently comes with a .dll and .dll.a (but no .a file). libzip is one of two missing dependencies that would allow us to build sigrok (see www.sigrok.org) natively on Windows using MSYS2.
Author   msys2
🌐
GitHub
github.com › ctabin › libzippp › blob › master › README.md
libzippp/README.md at master · ctabin/libzippp
December 8, 2019 - You can either use libzippp.dll and libzippp.lib to link dynamically the library or simply use libzippp_static.lib to link it statically.
Author   ctabin
🌐
Tek-Tips
tek-tips.com › home › forums › software › programmers › development tools › microsoft: visual c++
How to use static library libzip.lib in a new DLL project | Tek-Tips
January 13, 2025 - I first tried to link to the libzip project folders and then tried to stuff all header files of the libzip project into one new directory of my solution together with the lib and it gives less errors but still lists over hundred errors starting with "cannot open zipcomf.h" within zip.h and cascading in lots of undefined identifiers of classes/structs etc. I mainly followed the steps of https://learn.microsoft.com/en-us/c...ects?view=msvc-170#consuming-static-libraries for sttic libraries.
Find elsewhere
🌐
Blogger
hostagebrain.blogspot.com › 2016 › 06 › building-libzip-in-visual-studio-2013.html
tech notes of yet another programmer: building libzip in visual studio 2013
June 1, 2016 - You need compiled zlib - I wrote of compiling zlib here Download from http://www.nih.at/libzip/index.html archive libzip-1.1.3.tar.gz, unpack. md _build_x64_static_mt_mtd cd _build_x64_static_mtd if you want to use only static lib · go to 'D:\projects\libraries\libzip-1.1.3\lib\CMakeLists.txt' & comment pre-last block & uncomment last block.
🌐
The Mail Archive
mail-archive.com › debian-bugs-dist@lists.debian.org › msg2019016.html
Bug#1082371: libzip-dev: distribute static library with development package
On Wed, Oct 16, 2024 at 06:01:52PM +0200, Florian Ernst wrote: > On Fri, Sep 20, 2024 at 08:36:02AM -0400, ryan wrote: > > [...] > > It should be possible to get libzip to emit the static library by > > configuring > > CMake with `-DBUILD_SHARED_LIBS=OFF`. > > While this will indeed provide ...
🌐
Debian
packages.debian.org › sid › libzip-dev
Debian -- Details of package libzip-dev in sid
libzip is a C library for reading, creating, and modifying zip archives. Files can be added from data buffers, files, or compressed data copied directly from other zip archives. Changes made without closing the archive can be reverted. This package contains the static libraries and headers ...
🌐
GitHub
github.com › aseprite › libzip
GitHub - aseprite/libzip: libzip mirror · GitHub
Additionally, you'll need zlib (at least version 1.1.2). It comes with most operating systems nowadays, or you can get it at http://www.zlib.net/ When using a static Windows library, you need to define ZIP_STATIC when compiling packages using libzip.
Author   aseprite
🌐
Debian
packages.debian.org › bullseye › libzip-dev
Debian -- Details of package libzip-dev in bullseye
libzip is a C library for reading, creating, and modifying zip archives. Files can be added from data buffers, files, or compressed data copied directly from other zip archives. Changes made without closing the archive can be reverted. This package contains the static libraries and headers ...
🌐
GitHub
github.com › winlibs › libzip
GitHub - winlibs/libzip: C library for reading, creating, and modifying zip archives · GitHub
C library for reading, creating, and modifying zip archives - winlibs/libzip
Starred by 10 users
Forked by 2 users
Languages   C 89.8% | CMake 9.5%
🌐
Ubuntu
launchpad.net › ubuntu › focal › +package › libzip-dev
libzip-dev : Focal (20.04) : Ubuntu
Files can be added from data buffers, ... the archive can be reverted. . This package contains the static libraries and headers for developing applications that use the libzip library API....
🌐
Libzip
libzip.org
libzip - libzip
A C library for reading, creating, and modifying zip archives. libzip has been continuously developed since 2005. It is efficient, small, and flexible.
Top answer
1 of 1
1

This is not an MCVE ([SO]: How to create a Minimal, Reproducible Example (reprex (mcve))).

The statement "think that's because of the mismatch of C++ and C (zlib and libzip are C projects)" isn't backed up by anything, and if things are done right, there should be no problem.

2 key aspects to be considered. A VStudio project:

  1. Can "belong" to multiple solutions (there can be an M:N relationship between solutions and projects, and not 1:N (like people might be tempted to think))

  2. Must be properly configured. It can be trickier when:

    • Using external artefacts (libs, headers, ...). I explained this (pretty well, I'd say) for OpenSSL: [SO]: How to include OpenSSL in Visual Studio (@CristiFati's answer), so I won't do it again here

    • Having multiple platforms / configurations. Might check [SO]: Excel VBA, Can't Find DLL Entry Point from a DLL file (@CristiFati's answer)

Working on the following structure:

  • code00.sln:

    1. libz-static.vcxproj (from zlib-win-build (build-VS2022))

    2. libzip-static.vcxproj (from libzip-win-build (build-VS2022))

    3. dll00.vcxproj (uses the previous 2)

    4. app00.vcxproj (dummy wrapper app to test the .dll)

Files layout:

[cfati@CFATI-5510-0:e:\Work\Dev\StackExchange\StackOverflow\q079357913]> sopr.bat
### Set shorter prompt to better fit when pasted in StackOverflow (or other) pages ###

[prompt]>
[prompt]> :: --- Current dir ---
[prompt]> dir /b
code
data

[prompt]>
[prompt]> :: ------ code dir ------
[prompt]> dir /b code
app00
bin
code00.sln
Debug
dll00
libzip-win-build
x64
zlib-win-build

[prompt]>
[prompt]> :: --------- dll00 dir ---------
[prompt]> dir /b code\dll00
dll00.vcxproj
dll00.vcxproj.filters
dll00.vcxproj.user
include
src
Win32-Debug
x64-Debug

[prompt]>
[prompt]> dir /b code\dll00\include
dll00.hpp

[prompt]>
[prompt]> dir /b code\dll00\src
dll00.cpp

[prompt]>
[prompt]> :: --------- app00 dir ---------
[prompt]> dir /b code\app00
app00.vcxproj
app00.vcxproj.filters
app00.vcxproj.user
src
Win32-Debug
x64-Debug

[prompt]>
[prompt]> dir /b code\app00\src
main00.cpp

code/code00.sln:

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.12.35527.113
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "app00", "app00\app00.vcxproj", "{5C60F6F8-F3B7-4B08-9BB3-5FE6CEAA1F61}"
    ProjectSection(ProjectDependencies) = postProject
        {BD1F46B7-A799-43BC-AD53-58A2BE95ADFB} = {BD1F46B7-A799-43BC-AD53-58A2BE95ADFB}
    EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dll00", "dll00\dll00.vcxproj", "{BD1F46B7-A799-43BC-AD53-58A2BE95ADFB}"
    ProjectSection(ProjectDependencies) = postProject
        {B56D17BC-072B-42F3-844A-870A07AFBAAA} = {B56D17BC-072B-42F3-844A-870A07AFBAAA}
        {C490F8C7-D8E8-43C9-8D09-9BC8AB705098} = {C490F8C7-D8E8-43C9-8D09-9BC8AB705098}
    EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libzip-static", "libzip-win-build\build-VS2022\libzip-static\libzip-static.vcxproj", "{C490F8C7-D8E8-43C9-8D09-9BC8AB705098}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libz-static", "zlib-win-build\build-VS2022\libz-static\libz-static.vcxproj", "{B56D17BC-072B-42F3-844A-870A07AFBAAA}"
EndProject
Global
    GlobalSection(SolutionConfigurationPlatforms) = preSolution
        Debug|x64 = Debug|x64
        Debug|x86 = Debug|x86
        Release|x64 = Release|x64
        Release|x86 = Release|x86
    EndGlobalSection
    GlobalSection(ProjectConfigurationPlatforms) = postSolution
        {5C60F6F8-F3B7-4B08-9BB3-5FE6CEAA1F61}.Debug|x64.ActiveCfg = Debug|x64
        {5C60F6F8-F3B7-4B08-9BB3-5FE6CEAA1F61}.Debug|x64.Build.0 = Debug|x64
        {5C60F6F8-F3B7-4B08-9BB3-5FE6CEAA1F61}.Debug|x86.ActiveCfg = Debug|Win32
        {5C60F6F8-F3B7-4B08-9BB3-5FE6CEAA1F61}.Debug|x86.Build.0 = Debug|Win32
        {5C60F6F8-F3B7-4B08-9BB3-5FE6CEAA1F61}.Release|x64.ActiveCfg = Release|x64
        {5C60F6F8-F3B7-4B08-9BB3-5FE6CEAA1F61}.Release|x64.Build.0 = Release|x64
        {5C60F6F8-F3B7-4B08-9BB3-5FE6CEAA1F61}.Release|x86.ActiveCfg = Release|Win32
        {5C60F6F8-F3B7-4B08-9BB3-5FE6CEAA1F61}.Release|x86.Build.0 = Release|Win32
        {BD1F46B7-A799-43BC-AD53-58A2BE95ADFB}.Debug|x64.ActiveCfg = Debug|x64
        {BD1F46B7-A799-43BC-AD53-58A2BE95ADFB}.Debug|x64.Build.0 = Debug|x64
        {BD1F46B7-A799-43BC-AD53-58A2BE95ADFB}.Debug|x86.ActiveCfg = Debug|Win32
        {BD1F46B7-A799-43BC-AD53-58A2BE95ADFB}.Debug|x86.Build.0 = Debug|Win32
        {BD1F46B7-A799-43BC-AD53-58A2BE95ADFB}.Release|x64.ActiveCfg = Release|x64
        {BD1F46B7-A799-43BC-AD53-58A2BE95ADFB}.Release|x64.Build.0 = Release|x64
        {BD1F46B7-A799-43BC-AD53-58A2BE95ADFB}.Release|x86.ActiveCfg = Release|Win32
        {BD1F46B7-A799-43BC-AD53-58A2BE95ADFB}.Release|x86.Build.0 = Release|Win32
        {C490F8C7-D8E8-43C9-8D09-9BC8AB705098}.Debug|x64.ActiveCfg = Debug|x64
        {C490F8C7-D8E8-43C9-8D09-9BC8AB705098}.Debug|x64.Build.0 = Debug|x64
        {C490F8C7-D8E8-43C9-8D09-9BC8AB705098}.Debug|x86.ActiveCfg = Debug|Win32
        {C490F8C7-D8E8-43C9-8D09-9BC8AB705098}.Debug|x86.Build.0 = Debug|Win32
        {C490F8C7-D8E8-43C9-8D09-9BC8AB705098}.Release|x64.ActiveCfg = Release|x64
        {C490F8C7-D8E8-43C9-8D09-9BC8AB705098}.Release|x64.Build.0 = Release|x64
        {C490F8C7-D8E8-43C9-8D09-9BC8AB705098}.Release|x86.ActiveCfg = Release|Win32
        {C490F8C7-D8E8-43C9-8D09-9BC8AB705098}.Release|x86.Build.0 = Release|Win32
        {B56D17BC-072B-42F3-844A-870A07AFBAAA}.Debug|x64.ActiveCfg = Debug|x64
        {B56D17BC-072B-42F3-844A-870A07AFBAAA}.Debug|x64.Build.0 = Debug|x64
        {B56D17BC-072B-42F3-844A-870A07AFBAAA}.Debug|x86.ActiveCfg = Debug|Win32
        {B56D17BC-072B-42F3-844A-870A07AFBAAA}.Debug|x86.Build.0 = Debug|Win32
        {B56D17BC-072B-42F3-844A-870A07AFBAAA}.Release|x64.ActiveCfg = Release|x64
        {B56D17BC-072B-42F3-844A-870A07AFBAAA}.Release|x64.Build.0 = Release|x64
        {B56D17BC-072B-42F3-844A-870A07AFBAAA}.Release|x86.ActiveCfg = Release|Win32
        {B56D17BC-072B-42F3-844A-870A07AFBAAA}.Release|x86.Build.0 = Release|Win32
    EndGlobalSection
    GlobalSection(SolutionProperties) = preSolution
        HideSolutionNode = FALSE
    EndGlobalSection
EndGlobal

code/dll00/dll00.vcxproj:

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup Label="ProjectConfigurations">
    <ProjectConfiguration Include="Debug|Win32">
      <Configuration>Debug</Configuration>
      <Platform>Win32</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Release|Win32">
      <Configuration>Release</Configuration>
      <Platform>Win32</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Debug|x64">
      <Configuration>Debug</Configuration>
      <Platform>x64</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Release|x64">
      <Configuration>Release</Configuration>
      <Platform>x64</Platform>
    </ProjectConfiguration>
  </ItemGroup>
  <PropertyGroup Label="Globals">
    <VCProjectVersion>17.0</VCProjectVersion>
    <Keyword>Win32Proj</Keyword>
    <ProjectGuid>{bd1f46b7-a799-43bc-ad53-58a2be95adfb}</ProjectGuid>
    <RootNamespace>dll00</RootNamespace>
    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
    <ConfigurationType>DynamicLibrary</ConfigurationType>
    <UseDebugLibraries>true</UseDebugLibraries>
    <PlatformToolset>v143</PlatformToolset>
    <CharacterSet>Unicode</CharacterSet>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
    <ConfigurationType>DynamicLibrary</ConfigurationType>
    <UseDebugLibraries>false</UseDebugLibraries>
    <PlatformToolset>v143</PlatformToolset>
    <WholeProgramOptimization>true</WholeProgramOptimization>
    <CharacterSet>Unicode</CharacterSet>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
    <ConfigurationType>DynamicLibrary</ConfigurationType>
    <UseDebugLibraries>true</UseDebugLibraries>
    <PlatformToolset>v143</PlatformToolset>
    <CharacterSet>Unicode</CharacterSet>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
    <ConfigurationType>DynamicLibrary</ConfigurationType>
    <UseDebugLibraries>false</UseDebugLibraries>
    <PlatformToolset>v143</PlatformToolset>
    <WholeProgramOptimization>true</WholeProgramOptimization>
    <CharacterSet>Unicode</CharacterSet>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
  <ImportGroup Label="ExtensionSettings">
  </ImportGroup>
  <ImportGroup Label="Shared">
  </ImportGroup>
  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
  </ImportGroup>
  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
  </ImportGroup>
  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
  </ImportGroup>
  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
  </ImportGroup>
  <PropertyGroup Label="UserMacros" />
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    <OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>
    <IntDir>$(ProjectDir)$(Platform)-$(Configuration)\</IntDir>
    <TargetName>lib$(ProjectName)</TargetName>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>
    <IntDir>$(ProjectDir)$(Platform)-$(Configuration)\</IntDir>
    <TargetName>lib$(ProjectName)</TargetName>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
    <IntDir>$(ProjectDir)$(Platform)-$(Configuration)\</IntDir>
    <OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>
    <TargetName>lib$(ProjectName)</TargetName>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
    <IntDir>$(ProjectDir)$(Platform)-$(Configuration)\</IntDir>
    <OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>
    <TargetName>lib$(ProjectName)</TargetName>
  </PropertyGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    <ClCompile>
      <WarningLevel>Level3</WarningLevel>
      <SDLCheck>true</SDLCheck>
      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <ConformanceMode>true</ConformanceMode>
      <AdditionalIncludeDirectories>$(SolutionDir)dll00\include;$(SolutionDir)libzip-win-build\lib;$(SolutionDir)libzip-win-build\win32</AdditionalIncludeDirectories>
    </ClCompile>
    <Link>
      <SubSystem>Console</SubSystem>
      <GenerateDebugInformation>true</GenerateDebugInformation>
      <AdditionalLibraryDirectories>$(SolutionDir)$(Configuration)\</AdditionalLibraryDirectories>
      <AdditionalDependencies>$(CoreLibraryDependencies);libzip-static.lib;libz-static.lib;%(AdditionalDependencies)</AdditionalDependencies>
    </Link>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
    <ClCompile>
      <WarningLevel>Level3</WarningLevel>
      <FunctionLevelLinking>true</FunctionLevelLinking>
      <IntrinsicFunctions>true</IntrinsicFunctions>
      <SDLCheck>true</SDLCheck>
      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <ConformanceMode>true</ConformanceMode>
      <AdditionalIncludeDirectories>$(SolutionDir)dll00\include;$(SolutionDir)libzip-win-build\lib;$(SolutionDir)libzip-win-build\win32</AdditionalIncludeDirectories>
    </ClCompile>
    <Link>
      <SubSystem>Console</SubSystem>
      <EnableCOMDATFolding>true</EnableCOMDATFolding>
      <OptimizeReferences>true</OptimizeReferences>
      <GenerateDebugInformation>true</GenerateDebugInformation>
      <AdditionalLibraryDirectories>$(SolutionDir)$(Configuration)\</AdditionalLibraryDirectories>
      <AdditionalDependencies>$(CoreLibraryDependencies);libzip-static.lib;libz-static.lib;%(AdditionalDependencies)</AdditionalDependencies>
    </Link>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <ClCompile>
      <WarningLevel>Level3</WarningLevel>
      <SDLCheck>true</SDLCheck>
      <PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <ConformanceMode>true</ConformanceMode>
      <AdditionalIncludeDirectories>$(SolutionDir)dll00\include;$(SolutionDir)libzip-win-build\lib;$(SolutionDir)libzip-win-build\win32</AdditionalIncludeDirectories>
    </ClCompile>
    <Link>
      <SubSystem>Console</SubSystem>
      <GenerateDebugInformation>true</GenerateDebugInformation>
      <AdditionalLibraryDirectories>$(SolutionDir)$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
      <AdditionalDependencies>$(CoreLibraryDependencies);libzip-static.lib;libz-static.lib;%(AdditionalDependencies)</AdditionalDependencies>
    </Link>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
    <ClCompile>
      <WarningLevel>Level3</WarningLevel>
      <FunctionLevelLinking>true</FunctionLevelLinking>
      <IntrinsicFunctions>true</IntrinsicFunctions>
      <SDLCheck>true</SDLCheck>
      <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <ConformanceMode>true</ConformanceMode>
      <AdditionalIncludeDirectories>$(SolutionDir)dll00\include;$(SolutionDir)libzip-win-build\lib;$(SolutionDir)libzip-win-build\win32</AdditionalIncludeDirectories>
    </ClCompile>
    <Link>
      <SubSystem>Console</SubSystem>
      <EnableCOMDATFolding>true</EnableCOMDATFolding>
      <OptimizeReferences>true</OptimizeReferences>
      <GenerateDebugInformation>true</GenerateDebugInformation>
      <AdditionalLibraryDirectories>$(SolutionDir)$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
      <AdditionalDependencies>$(CoreLibraryDependencies);libzip-static.lib;libz-static.lib;%(AdditionalDependencies)</AdditionalDependencies>
    </Link>
  </ItemDefinitionGroup>
  <ItemGroup>
    <ClCompile Include="src\dll00.cpp" />
  </ItemGroup>
  <ItemGroup>
    <ClInclude Include="include\dll00.hpp" />
  </ItemGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
  <ImportGroup Label="ExtensionTargets">
  </ImportGroup>
</Project>

code/dll00/dll00.vcxproj.filters:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup>
    <Filter Include="Source Files">
      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
      <Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
    </Filter>
    <Filter Include="Header Files">
      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
      <Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
    </Filter>
    <Filter Include="Resource Files">
      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
    </Filter>
  </ItemGroup>
  <ItemGroup>
    <ClCompile Include="src\dll00.cpp">
      <Filter>Source Files</Filter>
    </ClCompile>
  </ItemGroup>
  <ItemGroup>
    <ClInclude Include="include\dll00.hpp">
      <Filter>Header Files</Filter>
    </ClInclude>
  </ItemGroup>
</Project>

code/dll00/include/dll00.hpp:

#pragma once

#include <string>

#if defined(_WIN32)
#  define F_OK 0
#  include <io.h>
#else
#  define _access access
#  include <unistd.h>
#endif

#if defined(_WIN32)
#  if defined(DLL00_EXPORTS)
#    define DLL00_EXPORT_API __declspec(dllexport)
#  else
#    define DLL00_EXPORT_API __declspec(dllimport)
#  endif
#else
#  define DLL00_EXPORT_API
#endif


namespace dll00 {

#if defined(__cplusplus)
extern "C" {
#endif

DLL00_EXPORT_API int zipFile(const std::string &archive, const std::string &file);

#if defined(__cplusplus)
}
#endif

}

code/dll00/src/dll00.cpp:

#define DLL00_EXPORTS
#include <dll00.hpp>

#include <cerrno>
#include <cstdio>

#include <zip.h>


#define ZIP_ERROR(ERR, NAME, TXT, RET) { \
    zip_error_t error; \
    zip_error_init_with_code(&error, ERR); \
    fprintf(stderr, TXT "\nFile: [%s]\nError: [%s]\n", NAME, zip_error_strerror(&error)); \
    zip_error_fini(&error); \
    return RET; \
}

namespace dll00 {

int zipFile(const std::string& archive, const std::string& file)
{
    if (_access(file.c_str(), F_OK) < 0) {
        return -1;
    }
    zip_t *pza = nullptr;
    int err = 0;
    if ((pza = zip_open(archive.c_str(), ZIP_CREATE, &err)) == nullptr) {
        ZIP_ERROR(err, archive.c_str(), "Could not open archve", -1);
    }

    zip_source_t *pzs = nullptr;
    zip_error_t zerr;
    if ((pzs = zip_source_file_create(file.c_str(), 0, ZIP_LENGTH_TO_END, &zerr)) == nullptr) {
        zip_close(pza);
        ZIP_ERROR(zerr.zip_err, file.c_str(), "Could not open file", -1);
    }
    zip_int64_t idx = -1;
    if ((idx = zip_file_add(pza, file.c_str(), pzs, ZIP_FL_OVERWRITE | ZIP_FL_ENC_UTF_8)) < 0) {
        zip_source_free(pzs);
        zip_close(pza);
        zip_error_t* pzert = zip_get_error(pza);
        if (pzert) {
            ZIP_ERROR(pzert->zip_err, file.c_str(), "Could not add file to archive", -1);
        } else {
            fprintf(stderr, "Could not add file to archive\n");
            return -1;
        }
    }
    zip_close(pza);
    pza = nullptr;
    fprintf(stdout, "Added file [%s] to archive [%s]\n", file.c_str(), archive.c_str());
    return 0;
}

}

code/app00/app00.vcxproj (manually stripped out from this project file everything related to Debug|Win32 configuration to stay below the max 30K chars SO answer limit):

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup Label="ProjectConfigurations">
    <ProjectConfiguration Include="Release|Win32">
      <Configuration>Release</Configuration>
      <Platform>Win32</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Debug|x64">
      <Configuration>Debug</Configuration>
      <Platform>x64</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Release|x64">
      <Configuration>Release</Configuration>
      <Platform>x64</Platform>
    </ProjectConfiguration>
  </ItemGroup>
  <PropertyGroup Label="Globals">
    <VCProjectVersion>17.0</VCProjectVersion>
    <Keyword>Win32Proj</Keyword>
    <ProjectGuid>{5c60f6f8-f3b7-4b08-9bb3-5fe6ceaa1f61}</ProjectGuid>
    <RootNamespace>app00</RootNamespace>
    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
    <ConfigurationType>Application</ConfigurationType>
    <UseDebugLibraries>false</UseDebugLibraries>
    <PlatformToolset>v143</PlatformToolset>
    <WholeProgramOptimization>true</WholeProgramOptimization>
    <CharacterSet>Unicode</CharacterSet>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
    <ConfigurationType>Application</ConfigurationType>
    <UseDebugLibraries>true</UseDebugLibraries>
    <PlatformToolset>v143</PlatformToolset>
    <CharacterSet>Unicode</CharacterSet>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
    <ConfigurationType>Application</ConfigurationType>
    <UseDebugLibraries>false</UseDebugLibraries>
    <PlatformToolset>v143</PlatformToolset>
    <WholeProgramOptimization>true</WholeProgramOptimization>
    <CharacterSet>Unicode</CharacterSet>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
  <ImportGroup Label="ExtensionSettings">
  </ImportGroup>
  <ImportGroup Label="Shared">
  </ImportGroup>
  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
  </ImportGroup>
  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
  </ImportGroup>
  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
  </ImportGroup>
  <PropertyGroup Label="UserMacros" />
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
    <IntDir>$(ProjectDir)$(Platform)-$(Configuration)\</IntDir>
    <OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <IntDir>$(ProjectDir)$(Platform)-$(Configuration)\</IntDir>
    <OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
    <IntDir>$(ProjectDir)$(Platform)-$(Configuration)\</IntDir>
    <OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>
  </PropertyGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
    <ClCompile>
      <WarningLevel>Level3</WarningLevel>
      <FunctionLevelLinking>true</FunctionLevelLinking>
      <IntrinsicFunctions>true</IntrinsicFunctions>
      <SDLCheck>true</SDLCheck>
      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <ConformanceMode>true</ConformanceMode>
      <AdditionalIncludeDirectories>$(SolutionDir)dll00\include</AdditionalIncludeDirectories>
    </ClCompile>
    <Link>
      <SubSystem>Console</SubSystem>
      <EnableCOMDATFolding>true</EnableCOMDATFolding>
      <OptimizeReferences>true</OptimizeReferences>
      <GenerateDebugInformation>true</GenerateDebugInformation>
      <AdditionalDependencies>$(CoreLibraryDependencies);libdll00.lib;%(AdditionalDependencies)</AdditionalDependencies>
      <AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
    </Link>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <ClCompile>
      <WarningLevel>Level3</WarningLevel>
      <SDLCheck>true</SDLCheck>
      <PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <ConformanceMode>true</ConformanceMode>
      <AdditionalIncludeDirectories>$(SolutionDir)dll00\include</AdditionalIncludeDirectories>
    </ClCompile>
    <Link>
      <SubSystem>Console</SubSystem>
      <GenerateDebugInformation>true</GenerateDebugInformation>
      <AdditionalDependencies>$(CoreLibraryDependencies);libdll00.lib;%(AdditionalDependencies)</AdditionalDependencies>
      <AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
    </Link>
…
🌐
Pelles C forum
forum.pellesc.de › index.php
How to compile libzip
November 17, 2019 - ► How to compile libzip · Started by GaborK, November 17, 2019, 09:58:59 PM Previous topic - Next topic · Print · Go Down Pages1 · User actions · Print · Go Up Pages1 · User actions · Pelles C forum · ► Pelles C · ► General discussions · ► How to compile libzip ·
🌐
Google
chromium.googlesource.com › external › github.com › nih-at › libzip › + › refs › tags › rel-1-2-0
refs/tags/rel-1-2-0 - external/github.com/nih-at/libzip - Git at Google
For generic installation instructions, ... systems nowadays, or you can get it at ... When using a static Windows library, you need to define ZIP_STATIC when compiling packages using libzip....
🌐
GitHub
github.com › msys2 › MINGW-packages › issues › 6736
Weird static libraries in libzip pkgconfig · Issue #6736 · msys2/MINGW-packages
July 30, 2020 - prefix=/mingw64 exec_prefix=${prefix} bindir=${exec_prefix}/bin libdir=${exec_prefix}/lib includedir=${prefix}/include zipcmp=${exec_prefix}/bin/zipcmp Name: libzip Description: library for handling zip archives Version: 1.6.1 Libs: -L${libdir} ...
Author   msys2