libzip with Visual Studio 2010

前端 未结 7 2198
萌比男神i
萌比男神i 2020-12-02 19:39

Is there anyway documentation for compiling libzip for Visual Studio 2010? Everything I have seen from the libzip website and Google has returned no results.

相关标签:
7条回答
  • 2020-12-02 20:04

    Using libzip-1.0.1, zlib-1.2.8, and VS Community 2013.

    Added to path:

    C:\Program Files (x86)\CMake\bin;C:\Windows\Microsoft.NET\Framework64\v4.0.30319

    The cmake line became:

    cmake .. -G"Visual Studio 12 Win64" -DCMAKE_INSTALL_PREFIX="C:\devel\installed\zlib"
    

    devel\libzip-1.0.1\lib\zip_source_filep.c:189 changed:

    mask = umask(S_IXUSR | S_IRWXG | S_IRWXO);
    

    to:

    mask = umask(_S_IREAD | _S_IWRITE);
    
    0 讨论(0)
  • 2020-12-02 20:04

    In Visual Studio 2015, Win64:

    If building libzip failing with a message like this:

    Could NOT find ZLIB (missing: ZLIB_LIBRARY) (found version "1.2.8").
    

    All you have to do is copy the generated 'zlib.dll/zlibd.zll' and 'zlib.lib/zlibd.lib' to the top of the zlib directory (where the .h/.c files are).

    0 讨论(0)
  • 2020-12-02 20:12

    In current zlib version, there is a contrib for this:

    zlib-1.2.8\contrib\vstudio\vc10\zlibvc.sln

    I got an error on load because one of the configurations wasn't valid on my machine, but a recompile took care of that. I also had to change the project properties>Configuration Properties>Linker>Input>Additional Dependencies for the Debug configuration to change zlibwapi.lib to zlibwapid.lib.

    0 讨论(0)
  • 2020-12-02 20:19

    Using

    • an environment variable %ZLIB_DIR% for the path to zlib-1.2.8,
    • %LIBZIP_DIR% for the path to libzip-1.0.1
    • VS 2015 Express Edition, and
    • the file %LIBZIP_DIR%/lib/zip_source_filep.c patched according to http://hg.nih.at/libzip/rev/80457805a1e7 ,

    the process for building zlib and libzip becomes this:


    Building zlib

    > cd /d %ZLIB_DIR% && md build & cd build
    > cmake .. -G"Visual Studio 14 2015 Win64"- DCMAKE_INSTALL_PREFIX="%ZLIB_DIR%"
    > msbuild /P:Configuration=Debug INSTALL.vcxproj
    > msbuild /P:Configuration=Release INSTALL.vcxproj
    


    Building libzip

    > cd /d %LIBZIP_DIR% && md build & cd build
    > cmake .. -G"Visual Studio 14 2015 Win64" -DCMAKE_PREFIX_PATH="%ZLIB_DIR%"
    > msbuild /P:Configuration=Debug ALL_BUILD.vcxproj
    > msbuild /P:Configuration=Release ALL_BUILD.vcxproj
    


    Done!

    (So you see, @MikeLischke, CMake does indeed work out-of-the-box sometimes...)

    0 讨论(0)
  • 2020-12-02 20:23

    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.

    0 讨论(0)
  • 2020-12-02 20:24

    Can't comment on answer above but was trying to get this to work and in the end found that the Output directory under the configuration properties and the comand in debugging.

    You can remove ALL_BUILD, ZERO_CHECK, INSTALL and PACKAGE and it will build fine without any of the linking errors or linux specific errors.

    0 讨论(0)
提交回复
热议问题