Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. Qt6.1.2 static cmake linux
Forum Updated to NodeBB v4.3 + New Features

Qt6.1.2 static cmake linux

Scheduled Pinned Locked Moved Unsolved Qt 6
8 Posts 3 Posters 1.3k 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.
  • B Offline
    B Offline
    balisong
    wrote on 5 Aug 2021, 11:34 last edited by
    #1

    I'm trying to use Qt6.1.2 static for my cmake project on Ubuntu (20.04)
    First of all, shared libs Qt6.1.2 works ok for this project but I want use static. This project also works with Qt5.15.2 static.

    1. Due to guides I'm building -static from sources:
    $ mkdir build
    $ cd build
    $ ../qt-everywhere-src-6.1.2/configure -static -prefix /path/to/install
    $ cmake --build . --parallel 4
    $ cmake --install .
    

    on the "cmake --build" its failed whith an error "directory non exist" so I create a directory by myself - mkdir build/qtbase/src/corelib/.rcc
    I think its a first bug, please add this mkdir into code, or explane how to do this steps correct.

    1. When I'm trying to build my project using this static Qt6.1.2 I see next errors while linking:
    /usr/bin/ld: 3rdparty/Qt/qt6/gcc_64/lib/libQt6Widgets.a(qapplication.cpp.o): in function `QApplicationPrivate::init()':
    qapplication.cpp:(.text._ZN19QApplicationPrivate4initEv+0xe): undefined reference to `qInitResources_qstyle()'
    /usr/bin/ld: qapplication.cpp:(.text._ZN19QApplicationPrivate4initEv+0x13): undefined reference to `qInitResources_qmessagebox()'
    /usr/bin/ld: 3rdparty/Qt/qt6/gcc_64/lib/libQt6Gui.a(qpdf.cpp.o): in function `QPdfEnginePrivate::QPdfEnginePrivate()':
    qpdf.cpp:(.text._ZN17QPdfEnginePrivateC2Ev+0x2d0): undefined reference to `qInitResources_qpdf()'
    collect2: error: ld returned 1 exit status
    make[2]: *** [CMakeFiles/build.make:237: ] Error 1
    make[1]: *** [CMakeFiles/Makefile2:338: CMakeFiles/all] Error 2
    make: *** [Makefile:84: all] Error 2
    

    I've spent a tons of time to find out what I'm doing wrong, I thought about some dependesies I've miss etc.
    Than I found this undefined references by paths:

    build/qtbase/src/widgets/.rcc/qrc_messagebox.cpp
    build/qtbase/src/widgets/.rcc/qrc_qstyle.cpp
    build/qtbase/src/widgets/.rcc/qrc_qstyle1.cpp
    build/qtbase/src/gui/.rcc/qrc_qpdf.cpp
    

    I just took these 4 files and built them into my project. errors are gone.
    It seems to me, these files should be a part of the libQt6Core.a but for some reason they don't get there if you build using -static
    I think its a second bug or explain me how to solve this errors correctly, please.

    1. After all my tries I built my project ok, got a binary file. But when I'm trying to run it I got an error:
    FactoryLoader::QFactoryLoader() ignoring "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3" since plugins are disabled in static builds
    qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
    This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
    
    Aborted (core dumped)
    

    Please help me with it. How to fix this? How it should works generally?

    1 Reply Last reply
    1
    • J Offline
      J Offline
      Jonas Kvinge
      wrote on 5 Aug 2021, 12:37 last edited by
      #2

      @balisong said in Qt6.1.2 static cmake linux:

      qpdf

      Try adding -skip qpdf to configure.

      1 Reply Last reply
      0
      • B Offline
        B Offline
        balisong
        wrote on 5 Aug 2021, 13:12 last edited by balisong 8 May 2021, 18:41
        #3

        @Jonas-Kvinge, I tried your suggestion and as a result of configure I see:

        CMake Warning:
          Manually-specified variables were not used by the project:
        
        	BUILD_qpdf
        

        As far as I understand, that means there is no option -skip qpdf in configure ?!
        I've already tried -skip qtwayland and if its applied, there is no such print.
        Are you sure this option is correct?
        upd: anyway I tried, result and errors same.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 5 Aug 2021, 18:52 last edited by
          #4

          Hi,

          The module names are "qtXXX". So it's "qtpdf".

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

          B 1 Reply Last reply 5 Aug 2021, 20:28
          1
          • S SGaist
            5 Aug 2021, 18:52

            Hi,

            The module names are "qtXXX". So it's "qtpdf".

            B Offline
            B Offline
            balisong
            wrote on 5 Aug 2021, 20:28 last edited by
            #5

            @SGaist I tried -skip qtpdf and get:

            CMake Warning:
              Manually-specified variables were not used by the project:
            
            	BUILD_qtpdf
            

            There is no such module also.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 5 Aug 2021, 21:00 last edited by
              #6

              Sorry, I just realized that it's unrelated to that module.

              The issue is within the qtbase module. So you might want to disable the pdf support in that module or possibly build a more recent version of Qt.

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

              B 1 Reply Last reply 6 Aug 2021, 08:48
              0
              • S SGaist
                5 Aug 2021, 21:00

                Sorry, I just realized that it's unrelated to that module.

                The issue is within the qtbase module. So you might want to disable the pdf support in that module or possibly build a more recent version of Qt.

                B Offline
                B Offline
                balisong
                wrote on 6 Aug 2021, 08:48 last edited by
                #7

                @SGaist a more recent version of Qt is only 6.2.0 beta. Im looking for much stable version, but anyway I tried 6.2.0 and issues same.

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 6 Aug 2021, 08:56 last edited by
                  #8

                  Did you check the bug report system ?

                  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
                  0

                  1/8

                  5 Aug 2021, 11:34

                  • Login

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