Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Explanation of QMAKE_CFLAGS_RELEASE and QMAKE_LFLAGS_RELEASE in mkspecs/qmake.conf

    Installation and Deployment
    2
    4
    4401
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      rubikon last edited by

      I want to compile Qt 5.0.2 statically with MSVC2010 and I tried to google how to do that.

      I've read that I should modify QMAKE_CFLAGS_RELEASE to '-Ol -Og -GL -MD' in the qmake.conf. The original flags are '-O2 -MD'

      Somewhere else I read that I have to modify QMAKE_LFLAGS_RELEASE.

      So I asked myself what do this flags mean? I wasn't able to find documentation of this macros/flags.

      Can someone explain me what this flags mean?

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi,

        CFLAGS are used at compilation time (by the compiler)
        LFLAGS at linking time (by the linker)

        The flags themselves are platform dependent

        The O flag is for optimization (speed/size etc...)
        MD to link against multi-threaded DLL runtime
        MT to link multi-threaded static runtime

        Hope it helps

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 0
        • R
          rubikon last edited by

          Thank you for your reply. That makes things a little bit clearer...

          If the O flag means optimization, what does the number or the second letter stands for? Ol, O2, Og?

          And what means the GL flag?

          What do I have to edit if I want a static build?

          Is there a general description of the flags?

          Edit: I think I found it "here":http://msdn.microsoft.com/en-us/library/fwkeyyhe.aspx

          Many questions :-)

          1 Reply Last reply Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            Depends on what you mean by static build:

            Qt static against dynamic runtime ? (Recommended)
            Simply run configure with -static.

            If you want Qt static against static runtime you'll have to edit the makespec and change MD to MT (there might be other modifications to do but I don't know them from the top of my head)

            IIRC there is something about that in the documentation.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply Reply Quote 0
            • First post
              Last post