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 安装
基础教程推荐
- 为什么派生模板类不能访问基模板类的标识符? 2021-01-01
- CString 到 char* 2021-01-01
- 如果我为无符号变量分配负值会发生什么? 2022-01-01
- 我应该对 C++ 中的成员变量和函数参数使用相同的名称吗? 2021-01-01
- 通过引用传递 C++ 迭代器有什么问题? 2022-01-01
- 为什么 typeid.name() 使用 GCC 返回奇怪的字符以及如 2022-09-16
- GDB 显示调用堆栈上函数地址的当前编译二进制文 2022-09-05
- 初始化列表*参数*评估顺序 2021-01-01
- 为什么 RegOpenKeyEx() 在 Vista 64 位上返回错误代码 2021-01-01
- 非静态 const 成员,不能使用默认赋值运算符 2022-10-09
