How to use zlib library in visual studio 2017?

后端 未结 3 728
一向
一向 2021-02-09 18:54

I want to use the zlib library in my c++ project. So, I have downloaded zlib library(zlib_1_2_8_msvc2015_64.zip). Then, I have created zlib fol

相关标签:
3条回答
  • 2021-02-09 19:07

    You have specified where to find the header files.

    You also need to find which library to bind and where to find it.

    For Visual Studio 2012:

    In linker section -> General -> additional library directories, you can specify the path where the library resides

    In linker section -> Input -> additional dependancy , you can specify the actual lib name to bind

    0 讨论(0)
  • 2021-02-09 19:08

    Its a simple fix copy all contents of msvc2015_64 directory into zlib directory and you are good to go.

    0 讨论(0)
  • 2021-02-09 19:14

    For static library installation , include the zlibstatic.lib and directories in the linker additional libraries and directories. For dynamic library , include the zlib.lib in the linker and copy the zlib.dll to the project output directory.

    Another option is to install vcpkg ( MS packager to install windows based open source projects) and use powershell command like so .\vcpkg install zlib:x64-windows-static. The zlib can be auto integrated to your project using .\vcpkg integrate install

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