admin管理员组文章数量:1193357
I'd like to compile (using MSVC 2022
) some third party project (fteqw) that depends on zlib
library. First to generate a solution to open in MSVC i'm using the cmake from the Visual Studio 2022 Developer Command Prompt. I'm getting an error:
The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
ZLIB_LIBRARY
linked by target "qtv" in directory D:/Pobrane/fteqw-master
I guess the zlib
library is just missing. The question is there a way to install zlib
package from Visual Studio 2022 Developer Command Prompt like on Linux system using apt-get, yum, etc.?
I'd like to compile (using MSVC 2022
) some third party project (fteqw) that depends on zlib
library. First to generate a solution to open in MSVC i'm using the cmake from the Visual Studio 2022 Developer Command Prompt. I'm getting an error:
The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
ZLIB_LIBRARY
linked by target "qtv" in directory D:/Pobrane/fteqw-master
I guess the zlib
library is just missing. The question is there a way to install zlib
package from Visual Studio 2022 Developer Command Prompt like on Linux system using apt-get, yum, etc.?
- here you are : developers.lseg.com/en/article-catalog/article/… – R.F. Commented Jan 23 at 17:03
- vcpkg is also a good option to obtain the zlib, and SDL2 dependencies. I am not sure if there are more. I glanced over the CMakeLists.txt for only a minute or so this morning when this question was in the Staging Ground. Edit: https://github.com/fte-team/fteqw/blob/master/CMakeLists.txt looks like there are several other dependencies, like OpenGL, jpeg, bzip2, freetype, vulkan ... I am not sure if these are hard dependencies or optional. With that said vcpkg could provide them all. – drescherjm Commented Jan 23 at 17:06
2 Answers
Reset to default 1Make sure vcpkg is installed in Visual Studio Installer. Use command vcpkg install zlib
.
Install In classic mode, run the following vcpkg command:
vcpkg install zlib
In manifest mode, run the following vcpkg command in your project directory:
vcpkg add port zlib
Reference: vcpkg in CMake projects
Use vcpkg
Another method (lower level and also more complicated) would be to:
Download ZLib from [GitHub]: CristiFati/Prebuilt-Binaries - (master) Prebuilt-Binaries/ZLib /v1
Unpack the .zip file locally (in "C:\Program Files")
When invoking CMake, pass e.g.:
-DZLIB_ROOT=C:\Program Files\ZLib\ZLib\1.3.1
(besides all other flags that you might have). It should pick it up from there- If you want to include it in a VStudio project directly, check [SO]: building DLL based on libzip-static.lib (@CristiFati's answer)
本文标签: cInstall zlib library on Windows for MSVCStack Overflow
版权声明:本文标题:c++ - Install zlib library on Windows for MSVC - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738483594a2089288.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论