Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Static linking fails for Qt libs.
Forum Updated to NodeBB v4.3 + New Features

Static linking fails for Qt libs.

Scheduled Pinned Locked Moved Unsolved General and Desktop
21 Posts 5 Posters 4.5k 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.
  • ademmlerA ademmler

    @jsulm My host crashed while compile.
    My simple question: Is there a log saved by default?

    This might be the case - Qt is a beast and who knows everything what's going on in the background.

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

    @ademmler said in Static linking fails for Qt libs.:

    My host crashed while compile

    How exactly do you build on this host?

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

    ademmlerA 1 Reply Last reply
    0
    • ademmlerA ademmler

      @jsulm My host crashed while compile.
      My simple question: Is there a log saved by default?

      This might be the case - Qt is a beast and who knows everything what's going on in the background.

      B Offline
      B Offline
      BwvB
      wrote on last edited by
      #13

      @ademmler
      Maybe you can be a bit more specific:

      How did you configure exactly. How did you run the compilation. And what do you mean with a crashing host.
      It broke down? You had to restart the machine?

      Regards
      Bertwim

      1 Reply Last reply
      0
      • jsulmJ jsulm

        @ademmler said in Static linking fails for Qt libs.:

        My host crashed while compile

        How exactly do you build on this host?

        ademmlerA Offline
        ademmlerA Offline
        ademmler
        wrote on last edited by ademmler
        #14

        @jsulm @BwvB

        To be precise it was after compile!
        I was reading the output from make - as my virtual machine collapsed.
        Because it took 12h to compile I am asking if there is somewhere a log file by default.

        However, now I got problem on top:
        When I try to launch qtcreator it fails.

        Possible reason:

        • Qt5static is the default - which was compiled without plattform plugins
        • Conflicts between different qt Versions
          5.15.16 dynamic (from installer)
          5.15.16 static (compiled by me)

        When I use qtchooser it has no effect
        When I set QT_SELECT no effect.

        ./qmake -query
        QT_SYSROOT:
        QT_INSTALL_PREFIX:/home/user/Qt/5.15.16/gcc_64
        QT_INSTALL_ARCHDATA:/home/user/Qt/5.15.16/gcc_64
        QT_INSTALL_DATA:/home/user/Qt/5.15.16/gcc_64
        QT_INSTALL_DOCS:/home/user/Qt/Docs/Qt-5.15.16
        QT_INSTALL_HEADERS:/home/user/Qt/5.15.16/gcc_64/include
        QT_INSTALL_LIBS:/home/user/Qt/5.15.16/gcc_64/lib
        QT_INSTALL_LIBEXECS:/home/user/Qt/5.15.16/gcc_64/libexec
        QT_INSTALL_BINS:/home/user/Qt/5.15.16/gcc_64/bin
        QT_INSTALL_TESTS:/home/user/Qt/5.15.16/gcc_64/tests
        QT_INSTALL_PLUGINS:/home/user/Qt/5.15.16/gcc_64/plugins
        QT_INSTALL_IMPORTS:/home/user/Qt/5.15.16/gcc_64/imports
        QT_INSTALL_QML:/home/user/Qt/5.15.16/gcc_64/qml
        QT_INSTALL_TRANSLATIONS:/home/user/Qt/5.15.16/gcc_64/translations
        QT_INSTALL_CONFIGURATION:/home/user/Qt/5.15.16/gcc_64
        QT_INSTALL_EXAMPLES:/home/user/Qt/Examples/Qt-5.15.16
        QT_INSTALL_DEMOS:/home/user/Qt/Examples/Qt-5.15.16
        QT_HOST_PREFIX:/home/user/Qt/5.15.16/gcc_64
        QT_HOST_DATA:/home/user/Qt/5.15.16/gcc_64
        QT_HOST_BINS:/home/user/Qt/5.15.16/gcc_64/bin
        QT_HOST_LIBS:/home/user/Qt/5.15.16/gcc_64/lib
        QMAKE_SPEC:linux-g++
        QMAKE_XSPEC:linux-g++
        QMAKE_VERSION:3.1
        QT_VERSION:5.15.16
        
        jsulmJ 1 Reply Last reply
        0
        • ademmlerA ademmler

          @jsulm @BwvB

          To be precise it was after compile!
          I was reading the output from make - as my virtual machine collapsed.
          Because it took 12h to compile I am asking if there is somewhere a log file by default.

          However, now I got problem on top:
          When I try to launch qtcreator it fails.

          Possible reason:

          • Qt5static is the default - which was compiled without plattform plugins
          • Conflicts between different qt Versions
            5.15.16 dynamic (from installer)
            5.15.16 static (compiled by me)

          When I use qtchooser it has no effect
          When I set QT_SELECT no effect.

          ./qmake -query
          QT_SYSROOT:
          QT_INSTALL_PREFIX:/home/user/Qt/5.15.16/gcc_64
          QT_INSTALL_ARCHDATA:/home/user/Qt/5.15.16/gcc_64
          QT_INSTALL_DATA:/home/user/Qt/5.15.16/gcc_64
          QT_INSTALL_DOCS:/home/user/Qt/Docs/Qt-5.15.16
          QT_INSTALL_HEADERS:/home/user/Qt/5.15.16/gcc_64/include
          QT_INSTALL_LIBS:/home/user/Qt/5.15.16/gcc_64/lib
          QT_INSTALL_LIBEXECS:/home/user/Qt/5.15.16/gcc_64/libexec
          QT_INSTALL_BINS:/home/user/Qt/5.15.16/gcc_64/bin
          QT_INSTALL_TESTS:/home/user/Qt/5.15.16/gcc_64/tests
          QT_INSTALL_PLUGINS:/home/user/Qt/5.15.16/gcc_64/plugins
          QT_INSTALL_IMPORTS:/home/user/Qt/5.15.16/gcc_64/imports
          QT_INSTALL_QML:/home/user/Qt/5.15.16/gcc_64/qml
          QT_INSTALL_TRANSLATIONS:/home/user/Qt/5.15.16/gcc_64/translations
          QT_INSTALL_CONFIGURATION:/home/user/Qt/5.15.16/gcc_64
          QT_INSTALL_EXAMPLES:/home/user/Qt/Examples/Qt-5.15.16
          QT_INSTALL_DEMOS:/home/user/Qt/Examples/Qt-5.15.16
          QT_HOST_PREFIX:/home/user/Qt/5.15.16/gcc_64
          QT_HOST_DATA:/home/user/Qt/5.15.16/gcc_64
          QT_HOST_BINS:/home/user/Qt/5.15.16/gcc_64/bin
          QT_HOST_LIBS:/home/user/Qt/5.15.16/gcc_64/lib
          QMAKE_SPEC:linux-g++
          QMAKE_XSPEC:linux-g++
          QMAKE_VERSION:3.1
          QT_VERSION:5.15.16
          
          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #15

          @ademmler I as I wrote before you can forward compiler output to a file. But I don't know why you actually need it? Simply start the build again, it will continue where it was interrupted.

          "When I try to launch qtcreator it fails" - start it ffom a terminal and see whether there are any errors.

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

          ademmlerA 1 Reply Last reply
          0
          • jsulmJ jsulm

            @ademmler I as I wrote before you can forward compiler output to a file. But I don't know why you actually need it? Simply start the build again, it will continue where it was interrupted.

            "When I try to launch qtcreator it fails" - start it ffom a terminal and see whether there are any errors.

            ademmlerA Offline
            ademmlerA Offline
            ademmler
            wrote on last edited by
            #16

            @jsulm I wanted first to resolve missing stuff before I redo it.

            jsulmJ 1 Reply Last reply
            0
            • ademmlerA ademmler

              @jsulm I wanted first to resolve missing stuff before I redo it.

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

              @ademmler said in Static linking fails for Qt libs.:

              I wanted first to resolve missing stuff before I redo it

              Reado what? I did not suggest to redo anything, I seggested to simply continue the build after crash. And what do you mean by "missing stuff"?

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

              1 Reply Last reply
              0
              • B Offline
                B Offline
                BwvB
                wrote on last edited by
                #18

                I still have no idea what precisely you are doing. Apparently, ,you are working on a virtual machine.
                But you give no specifics about what you are really doing, other than in general terms.
                But do you work from a terminal? (if not, I strongly suggest doing so). In my personal experience this is the best way to have control over the whole procedure.

                When you compile/install from a terminal, the procedure is in principle straight forward; Forget about QtCreator. first make sure the Qt libs are installed properly. Once that is ok, you can proceed with QtCreator (although personally I am no fan).
                In the source tree, you have to run first the .configure script. It is all in the README.
                It will tell you which features will be enabled, disabled, or if there are any essential packages missing.
                You might have to run the configuration several times in order to satisfy all requirements.

                Next, once you have ensured that all essential packages are available on you virtual machine, you can go to the next phase:
                compilation. Is your cmake-toolchain ok?

                Assuming that the compilation succeeds, the next stage is to install. Qt will be installed in the directory you specify when you run the configure script, e.g. ./configure -prefix /usr/local/qt-6.6.1
                or ./configure -static -prefix /usr/local/qt-6.6.1-static
                This directory is important. I always make sure that the static version of Qt is install in a separate directory, e.g. /usr/local/qt-6.6.1-static. Moreover, once done, I ensure the environment variable QTDIR is set to this very directory. This way, you prevent version conflicts.

                You see, there is so much additional info needed to address your issue systematically.

                Good luck
                Bertwim

                ademmlerA 1 Reply Last reply
                0
                • B BwvB

                  I still have no idea what precisely you are doing. Apparently, ,you are working on a virtual machine.
                  But you give no specifics about what you are really doing, other than in general terms.
                  But do you work from a terminal? (if not, I strongly suggest doing so). In my personal experience this is the best way to have control over the whole procedure.

                  When you compile/install from a terminal, the procedure is in principle straight forward; Forget about QtCreator. first make sure the Qt libs are installed properly. Once that is ok, you can proceed with QtCreator (although personally I am no fan).
                  In the source tree, you have to run first the .configure script. It is all in the README.
                  It will tell you which features will be enabled, disabled, or if there are any essential packages missing.
                  You might have to run the configuration several times in order to satisfy all requirements.

                  Next, once you have ensured that all essential packages are available on you virtual machine, you can go to the next phase:
                  compilation. Is your cmake-toolchain ok?

                  Assuming that the compilation succeeds, the next stage is to install. Qt will be installed in the directory you specify when you run the configure script, e.g. ./configure -prefix /usr/local/qt-6.6.1
                  or ./configure -static -prefix /usr/local/qt-6.6.1-static
                  This directory is important. I always make sure that the static version of Qt is install in a separate directory, e.g. /usr/local/qt-6.6.1-static. Moreover, once done, I ensure the environment variable QTDIR is set to this very directory. This way, you prevent version conflicts.

                  You see, there is so much additional info needed to address your issue systematically.

                  Good luck
                  Bertwim

                  ademmlerA Offline
                  ademmlerA Offline
                  ademmler
                  wrote on last edited by
                  #19

                  @BwvB Dear Bertwim,

                  thx for your response. My mistake - i have mixed to topics here.

                  1. Ofcourse I compile from terminal.
                  2. After compile and "make install" I ended up with 2 Qt Version:
                  • commercial license dynamic
                  • self compiled static

                  now I want to use Qtcreator for opening my project and work on this.
                  But after the compile and install everything is screwed up and qtcreator won't start any longer - while maintenance tool still does ...

                  My question: I need to select the right qt installation to be used with qtcreator ... how do I do this if the QT_SELECT has no effect?

                  B 1 Reply Last reply
                  0
                  • ademmlerA ademmler

                    @BwvB Dear Bertwim,

                    thx for your response. My mistake - i have mixed to topics here.

                    1. Ofcourse I compile from terminal.
                    2. After compile and "make install" I ended up with 2 Qt Version:
                    • commercial license dynamic
                    • self compiled static

                    now I want to use Qtcreator for opening my project and work on this.
                    But after the compile and install everything is screwed up and qtcreator won't start any longer - while maintenance tool still does ...

                    My question: I need to select the right qt installation to be used with qtcreator ... how do I do this if the QT_SELECT has no effect?

                    B Offline
                    B Offline
                    BwvB
                    wrote on last edited by BwvB
                    #20

                    @ademmler Ah, I see what you are after. I think if you know the qt-installation that is needed for QtCreator (the one that is given to you originally) you can set those in a separate script (e.g. a bash script). So ensure QTDIR and perhaps LD_LIBRARY_CONFIG in this script are referring to the original QtConfig; then start QtCreator from this script. You can start this selfmade QtCreator script from a desktop icon, if you want.
                    In other words, ensure that in you script the environment is set ok for your copy of QtCreator. Then run this script.

                    Success,
                    Bertwim

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      SimonSchroeder
                      wrote on last edited by
                      #21

                      I'm a little late to the party 😉. I have a comment about the original problem that there are some libraries which are dynamically linked. This could be solved for the Qt libs through recompilation (like you are trying), but it doesn't solve it for the other libraries. In any case it is a good idea to create an AppImage that has all the libraries included. In this case you can even include the Qt dynamic libraries into the AppImage. We are using a combination of linuxdeploy and linuxdeployqt to create the AppImage. In the end you have a single file that just looks like an executable to the end user (it is actually an executable which will mount the AppImage and run a specific command after that).

                      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