Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Change order of the parameters passed to g++
Forum Updated to NodeBB v4.3 + New Features

Change order of the parameters passed to g++

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
8 Posts 3 Posters 1.2k Views 2 Watching
  • 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.
  • F Offline
    F Offline
    Firehand
    wrote on last edited by
    #1

    Hello,

    I am trying to statically link stdc++ to my binary using -static-libstdc++ and -static-libgcc on Ubuntu. Its always linked dynamically and the problem seems to be that the mkspec tree is putting them immediately after g++. I tested it with simple c++ example and the linker only links the lib if the parameters are passed at the end.
    I'm not sure if its the real problem with Qt static lib linking but i don't know how to customize it and test.

    Thanks!

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Since you narrowed the problem down to mkspecs - modify the definitions you are using to fix the problem. The only issue with such solution is that you need to repeat the process (or copy-paste your custom mkspecs) to all Qt versions you are using.

      (Z(:^

      1 Reply Last reply
      0
      • F Offline
        F Offline
        Firehand
        wrote on last edited by
        #3

        If there is another way i would prefer to not change mkspecs, but i cant compile my project with static c++ libs in any way.

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          Just to be sure: using QMAKE_LFLAGS does not help either?

          (Z(:^

          F 1 Reply Last reply
          0
          • sierdzioS sierdzio

            Just to be sure: using QMAKE_LFLAGS does not help either?

            F Offline
            F Offline
            Firehand
            wrote on last edited by
            #5

            @sierdzio said in Change order of the parameters passed to g++:

            Just to be sure: using QMAKE_LFLAGS does not help either?

            No, i tried in LIBS, CONFIG, QMAKE_FLAGS{DEBUG/RELEASE} - without success. Compiling any regular c++ with g++ works.

            jsulmJ 1 Reply Last reply
            0
            • F Firehand

              @sierdzio said in Change order of the parameters passed to g++:

              Just to be sure: using QMAKE_LFLAGS does not help either?

              No, i tried in LIBS, CONFIG, QMAKE_FLAGS{DEBUG/RELEASE} - without success. Compiling any regular c++ with g++ works.

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Firehand Did you try QMAKE_LFLAGS (not QMAKE_FLAGS) as @sierdzio suggested?

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              F 1 Reply Last reply
              0
              • jsulmJ jsulm

                @Firehand Did you try QMAKE_LFLAGS (not QMAKE_FLAGS) as @sierdzio suggested?

                F Offline
                F Offline
                Firehand
                wrote on last edited by
                #7

                @jsulm said in Change order of the parameters passed to g++:

                QMAKE_LFLAGS

                Ah sorry, i just copy his replay. I meant QMAKE_LFLAGS and QMAKE_CXXLAGS

                1 Reply Last reply
                0
                • F Offline
                  F Offline
                  Firehand
                  wrote on last edited by
                  #8

                  Could anyone help please?

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved