Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Zlib library error | undefinied reference to



  • Hi all!

    I have a question about using Qt with zlib library.
    I create project. In *.pro I add

    include($$[QT_INSTALL_PREFIX]/Src/qtbase/src/3rdparty/zlib.pri)
    

    Next, I include zlib header #include <zlib.h>, when I compile everything is good but when I use function from zlib like gzopen Compilator gives error message:

    undefined reference to 'gzopen'
    

    How can I solve that problem ?



  • @bondrusiek said in Zlib library error | undefinied reference to:

    when I use function from zlib like gzopen Compilator gives error message:
    undefined reference to 'gzopen'

    It's the linker complaining indeed...

    Are you sure you have the shared object for Qt zlib library available?

    How do you install Qt framework? Is it configured for -qt-zlib? See documentation regarding 3rd party libraries


Log in to reply