Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
532 views
in Technique[技术] by (71.8m points)

c++ - how to add zlib to an existing qt installation

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!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...