Git Product home page Git Product logo

Comments (2)

arietto avatar arietto commented on July 20, 2024

As a workaround, I use the following call
qmake.exe DEFINES+="STATIC_QJSON_SERIALIZER"

I have the following local modification in qtjsonserializer_global.h

#if defined(STATIC_QJSON_SERIALIZER)
#define Q_JSONSERIALIZER_EXPORT
#else
#if defined(QT_BUILD_JSONSERIALIZER_LIB)
#define Q_JSONSERIALIZER_EXPORT Q_DECL_EXPORT
#else
#define Q_JSONSERIALIZER_EXPORT Q_DECL_IMPORT
#endif
#endif

Each static library consumer must define STATIC_QJSON_SERIALIZER.

from qtjsonserializer.

Skycoder42 avatar Skycoder42 commented on July 20, 2024

I am aware of the planned changes in build systems of the Qt Company. I am still using qmake as all official Qt modules are currenlty built with qmake as well. I need some of their internal tools to create "true" Qt modules. I will of course switch my projects to cmake once Qt officially performs this step as well.

Regarding the static part: I always though Qt would automatically define the Q_DECL_EXPORT and Q_DECL_IMPOR macros to be empty for static builds. After checking how qtbase handles this, I realised that was a false assumption. Taken from QtNetwork, the library export macros are defined as:

#ifndef QT_STATIC
#  if defined(QT_BUILD_NETWORK_LIB)
#    define Q_NETWORK_EXPORT Q_DECL_EXPORT
#  else
#    define Q_NETWORK_EXPORT Q_DECL_IMPORT
#  endif
#else
#  define Q_NETWORK_EXPORT
#endif

You can use the same as workround with Q_JSONSERIALIZER_EXPORT until I find the time to update the code base. This way you should be able to use the library statically without defining that extra macro in any consumer. I will keep the issue open until this was fixed in the code.

from qtjsonserializer.

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.