如何将zlib添加到现有的qt安装 [英] how to add zlib to an existing qt installation

查看:275
本文介绍了如何将zlib添加到现有的qt安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将zlib添加到现有的Qt安装。我在这里相当新,所以请给我详细的描述!
感谢您的帮助!

解决方案

zlib包含在核心Qt库中。如果要在Qt程序中使用zlib函数,则只需要在src / 3rdparty / zlib中包含zlib.h。参见例如在src / corelib / tools中的QByteArray的实现。



如果你想使用quazip,只需添加库到你的项目。它基于Qt库。注意建立与您的Qt安装对应的正确的qyazip库。



通过添加以下行到您的项目文件,得到正确的包含路径:

  INCLUDEPATH + = $$ [QT_INSTALL_PREFIX] / src / 3rdparty / zlib 

对于Qt5,请参阅Thorbjørn的注释:使用 #include< QtZlib / zlib.h> / p>

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 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.

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

For Qt5, see Thorbjørn's comment: it is sufficient to use #include <QtZlib/zlib.h>.

这篇关于如何将zlib添加到现有的qt安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆