c++ - 使用 Visual Studio 2017 和 cmake 中的 libzip 库

标签 c++ cmake visual-studio-2017 runtime libzip

我有一个最初是在 Linux 中编写的 C++ 程序。该程序使用 libzip 库中的函数:

https://libzip.org

我现在正在 Visual Studio 2017 中使用基于 Windows 的平台。一切正常,因为我基本上可以使用与 Linux 平台上使用的相同的 cmake 文件。但是,在 Linux 中我使用包管理器来安装 libzip。我在 Windows 中没有该选项。我不知何故需要为 libzip 构建 Windows 版本,并将文件(头文件和 lib 文件)包含在我的 CMakeLists.txt 文件中。有人可以帮我提供这方面的分步指南吗?

最佳答案

看看vcpkg 。它是 Windows 平台的包管理器。它为 Windows 构建并安装了许多开源库。 libzip 被特别提及为端口之一。

关于c++ - 使用 Visual Studio 2017 和 cmake 中的 libzip 库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47690772/

相关文章:

path - CMake如何从编译错误中删除路径

visual-studio-2010 - 链接 : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt

c++ - 如何不使用 `export` 关键字从模块导出函数和类?

c++ - 从其他进程获取模块句柄

c++ - boost json 解析器的 json 数组映射问题

c++ - 比较两个字符串(但类型不同)

visual-studio - "View Source"选项在 Live Visual Tree Visual Studio 2017 中始终处于禁用状态

c++ - 重载 operator<< 时 std::endl 的类型未知

c++ - 如何使用 Node C++ 插件部署动态库?

c# - Visual Studio 的 'watch' 错误地将 Vector<float> 中的一半数字显示为零