how to add zlib to an existing qt installation(如何将 zlib 添加到现有的 qt 安装)
问题描述
如何将 zlib 添加到 Qt 的现有安装中.我在这方面很新,所以请给我详细的描述!提前感谢您的帮助!
How can I add zlib to an existing installation of Qt. I m pretty new in this so please give me detailed description! Thanks for your help in advance!
推荐答案
zlib 包含在核心 Qt 库中.如果你想在 Qt 程序中使用 zlib 函数,你只需要包含在 src/3rdparty/zlib 中的 zlib.h.见例如src/corelib/tools 中 QByteArray 的实现.
zlib is contained in the core Qt libraries. If you want to use the zlib functions in a Qt program, you only have to include zlib.h which is in src/3rdparty/zlib. See e.g. the implementation of QByteArray in src/corelib/tools.
如果您想使用 quazip,只需将库添加到您的项目中.它基于 Qt 库.注意构建与您的 Qt 安装相对应的正确 qyazip 库.
If you want to use quazip, just add the library to your project. It is based on the Qt libraries. Take care to build the correct qyazip library that corresponds to your Qt installation.
通过将以下行添加到项目文件中,您可以获得正确的包含路径:
You get the correct include path by adding the following line to your project file:
INCLUDEPATH += $$[QT_INSTALL_PREFIX]/src/3rdparty/zlib
对于 Qt5,请参阅 Thorbjørn 的评论:使用 #include
就足够了.
For Qt5, see Thorbjørn's comment: it is sufficient to use #include <QtZlib/zlib.h>
.
这篇关于如何将 zlib 添加到现有的 qt 安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何将 zlib 添加到现有的 qt 安装


基础教程推荐
- 如何通过C程序打开命令提示符Cmd 2022-12-09
- 这个宏可以转换成函数吗? 2022-01-01
- C++结构和函数声明。为什么它不能编译? 2022-11-07
- 常量变量在标题中不起作用 2021-01-01
- 静态库、静态链接动态库和动态链接动态库的 .lib 文件里面是什么? 2021-01-01
- 如何检查GTK+3.0中的小部件类型? 2022-11-30
- 我有静态或动态 boost 库吗? 2021-01-01
- 如何将 std::pair 的排序 std::list 转换为 std::map 2022-01-01
- 在 C++ 中计算滚动/移动平均值 2021-01-01
- 如何在 C++ 中初始化静态常量成员? 2022-01-01