Giter Club home page Giter Club logo

Comments (3)

stachenov avatar stachenov commented on August 18, 2024

It really depends on your build environment. If building from command line with qmake, running qmake LIBS+=-lz is enough. If building from Qt Creator, specifying LIBS+=-lz in the project settings will do. It is really machine-specific, that's why it isn't in the .pro file.

from quazip.

dlautz314 avatar dlautz314 commented on August 18, 2024

Ok, I just saw your comments per #23 right after I posted, of course.

I was just hoping for an approach to treat submodule more independently (didn't require changes to top-level parent project or build), but it is workable.

from quazip.

RichardTea avatar RichardTea commented on August 18, 2024

I use the following quazip_static.pri for Windows, Mac and Linux:
Requires Qt5 on Windows due to header fun and games for static builds, though this might no longer be necessary.

DEFINES *= QUAZIP_STATIC

include($$PWD/../quazip.pri)

win32 {
    # On Windows zlib.h is not an SDK header
    # Redirect to the Qt5 one
    greaterThan(QT_MAJOR_VERSION, 4) {
        INCLUDEPATH *= $$PWD
        HEADERS += $$PWD/zlib.h
    } else {
        # There isn't a neat workaround in older versions of Qt
        error(quazip_static.pri requires Qt5 or later)
    }
}

unix {
    # Unix (Linux, Mac, BSD) have a system zlib library
    LIBS += -lz
}

Obviously update the include() path to find quazip/quazip.pri as needed.

The zlib.h referred to contains the following:

// Workaround for zlib.h on Windows
// Requires Qt5

#ifdef WIN32
#include <QtZlib/zlib.h>
#endif

I'm not sure if that's actually still needed for static builds, as I first did this around QuaZip 0.7.1

from quazip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.