問題描述
如何將 zlib 添加到 Qt 的現(xiàn)有安裝中.我在這方面很新,所以請給我詳細的描述!提前感謝您的幫助!
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 函數(shù),你只需要包含在 src/3rdparty/zlib 中的 zlib.h.見例如src/corelib/tools 中 QByteArray 的實現(xiàn).
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 庫.注意構(gòu)建與您的 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>
.
這篇關(guān)于如何將 zlib 添加到現(xiàn)有的 qt 安裝的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!