Take a look at vcpkg. It is a package manger for the Windows platform. It builds and installs many open source libraries for Windows. libzip is mentioned specifically as one of the ports.
Take a look at vcpkg. It is a package manger for the Windows platform. It builds and installs many open source libraries for Windows. libzip is mentioned specifically as one of the ports.
Is it possible for you to use the Nuget Package Manager within Visual Studio?
- right click on your solution
- select "Manage packages for your solution"
- search for libzip
- select lipzip and click install
- you should now be able to
#include "zip.h"
Edit:
Before starting on the answer provided here, it appears that this may no longer be an issue going by @Thomas Klausner's answer below.
The following should get you a VS10 solution:
If you've not already done so, install CMake
Download and extract zlib to e.g.
C:\devel. The download links are about halfway down the homepage. Currently this provides zlib version 1.2.7.To work around this CMake bug which affects 64-bit Windows only, add
if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND MSVC) set_target_properties(zlibstatic PROPERTIES STATIC_LIBRARY_FLAGS "/machine:x64") endif()to the end of C:\devel\zlib-1.2.7\CMakeLists.txt
Download and extract libzip to e.g.
C:\develIn a VS10 command prompt,
cd C:\devel\zlib-1.2.7mkdir build && cd buildcmake .. -G"Visual Studio 10" -DCMAKE_INSTALL_PREFIX="C:\devel\installed\zlib"This sets the install path toC:\devel\installed\zlibrather than the defaultC:\Program Files\zlib. For 64-bit Windows, use"Visual Studio 10 Win64"as the-Gparameter.msbuild /P:Configuration=Debug INSTALL.vcxprojmsbuild /P:Configuration=Release INSTALL.vcxprojcd C:\devel\libzip-0.10.1mkdir build && cd buildcmake .. -G"Visual Studio 10" -DCMAKE_PREFIX_PATH="C:\devel\installed\zlib"Set the path to wherever you installed zlib so that CMake can find zlib's include files and libs. Again, for 64-bit Windows, use"Visual Studio 10 Win64"as the-Gparameter.
This should result in C:\devel\libzip-0.10.1\build\libzip.sln. It looks like there are a few POSIX-specific problems in the code, but they should hopefully be fairly easy to resolve (e.g. in zipconf.h #include <inttypes.h> needs replaced with #include <stdint.h>; there are some snprintf calls needing replaced e.g. with _snprintf).
I can't comment, so just in addition to Fraser's answer: In the last days, libzip's latest repository version should compile on VS without additional patches. Please try it out and let the developers know if parts are still missing.