Qt World Summit: Register Today!

Defining preprocessor macros in pro file

  • hi everyone,

    I defined many macros in pro file each of them in project file , (I am trying to implement Qt Assistant topic creating shared libs)

    @ #include <QtCore/QtGlobal>

    #if defined(MYSHAREDLIB_LIBRARY)





    one of them always defines Q_DECL_IMPORT instead Q_DECL_EXPORT , I spent alot of time tracking the code, syntax, but in vain.

  • Hi.

    I don't if this help, but anyway.

    In your .pro file you will have



    this means that when you are compiling your program, whenever the compiler reads
    it will replace with

    and when you run your applicacion,
    is not defined, so it will replace

    sorry if it was not your doubt. i did not understand you question anyway.

  • thank you luisvaldes88 for reply

    but the proposed way that macros are intended to work is:

    in the same project
    should be @Q_DECL_EXPORT@

    out side the project
    should be @Q_DECL_IMPORT@

    I think it is qmake issue because of the dependencies between the libs , I noticed that the calling libs (which use the base) built first although the base lib qmaked first

Log in to reply