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. What is required for link Widgets?
QtWS25 Last Chance

What is required for link Widgets?

Scheduled Pinned Locked Moved Solved Installation and Deployment
linuxopensusewidgets
15 Posts 3 Posters 2.1k Views
  • 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.
  • Christian EhrlicherC Offline
    Christian EhrlicherC Offline
    Christian Ehrlicher
    Lifetime Qt Champion
    wrote on last edited by
    #2

    Simply try out to see what linker errors you get. I would guess there are no errors when you use qmake or cmake.

    Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
    Visit the Qt Academy at https://academy.qt.io/catalog

    C 1 Reply Last reply
    0
    • Christian EhrlicherC Christian Ehrlicher

      Simply try out to see what linker errors you get. I would guess there are no errors when you use qmake or cmake.

      C Offline
      C Offline
      continue98
      wrote on last edited by continue98
      #3

      @Christian-Ehrlicher build.log. Is linked:

      "Qt5Core", 
      "Qt5Gui",
      "Qt5Widgets",
      "Qt5EventDispatcherSupport",
      "Qt5FontDatabaseSupport",
      "Qt5PlatformCompositorSupport",
      "Qt5ThemeSupport",
      "qtfreetype",
      "qtlibpng",
      "qtpcre2",
      "qtharfbuzz",
      "dl",
      "pthread"
      

      what the linker still lacks libraries?

      1 Reply Last reply
      0
      • Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #4

        @continue98 said in What is required for link Widgets?:

        what the linker still lacks libraries?

        ?

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        C 1 Reply Last reply
        0
        • Christian EhrlicherC Christian Ehrlicher

          @continue98 said in What is required for link Widgets?:

          what the linker still lacks libraries?

          ?

          C Offline
          C Offline
          continue98
          wrote on last edited by
          #5

          @Christian-Ehrlicher what libraries do I need to add in order for the app to link?

          JonBJ 1 Reply Last reply
          0
          • C continue98

            @Christian-Ehrlicher what libraries do I need to add in order for the app to link?

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by
            #6

            @continue98
            I think you need to make it a lot clearer that your one word build.log is actually a link to your compiler (linker) output.....

            C 1 Reply Last reply
            0
            • JonBJ JonB

              @continue98
              I think you need to make it a lot clearer that your one word build.log is actually a link to your compiler (linker) output.....

              C Offline
              C Offline
              continue98
              wrote on last edited by
              #7

              @JonB said in What is required for link Widgets?:

              I think you need to make it a lot clearer that your one word build.log is actually a link to your compiler (linker) output.....

              What? build.log - stdout / stderr from make. What should I show?

              JonBJ 1 Reply Last reply
              0
              • C continue98

                @JonB said in What is required for link Widgets?:

                I think you need to make it a lot clearer that your one word build.log is actually a link to your compiler (linker) output.....

                What? build.log - stdout / stderr from make. What should I show?

                JonBJ Offline
                JonBJ Offline
                JonB
                wrote on last edited by JonB
                #8

                @continue98 said in What is required for link Widgets?:

                What?

                All you wrote earlier was:

                @Christian-Ehrlicher build.log. Is linked:

                I for one did not understand that the word build.log in that line was actually a hyperlink to the output from your link, showing what remains unreferenced. Maybe @Christian-Ehrlicher did notice this, maybe he did not. It took me a while to spot.

                All I am saying is, I would have indicated something like:

                Please click on this link to see what remains unreferenced when I try to link: build.log.

                Christian EhrlicherC 1 Reply Last reply
                0
                • JonBJ JonB

                  @continue98 said in What is required for link Widgets?:

                  What?

                  All you wrote earlier was:

                  @Christian-Ehrlicher build.log. Is linked:

                  I for one did not understand that the word build.log in that line was actually a hyperlink to the output from your link, showing what remains unreferenced. Maybe @Christian-Ehrlicher did notice this, maybe he did not. It took me a while to spot.

                  All I am saying is, I would have indicated something like:

                  Please click on this link to see what remains unreferenced when I try to link: build.log.

                  Christian EhrlicherC Offline
                  Christian EhrlicherC Offline
                  Christian Ehrlicher
                  Lifetime Qt Champion
                  wrote on last edited by
                  #9

                  @JonB: No I did not.

                  @continue98: How did you build Qt. What build system do you use (I already asked you). From looking at your log I doubt you're correctly linking against the other static Qt libs.

                  Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                  Visit the Qt Academy at https://academy.qt.io/catalog

                  C 1 Reply Last reply
                  1
                  • Christian EhrlicherC Christian Ehrlicher

                    @JonB: No I did not.

                    @continue98: How did you build Qt. What build system do you use (I already asked you). From looking at your log I doubt you're correctly linking against the other static Qt libs.

                    C Offline
                    C Offline
                    continue98
                    wrote on last edited by
                    #10

                    @Christian-Ehrlicher I am use build-system premake5. All libraries that I link to the project:

                    "Qt5Core", 
                    "Qt5Gui",
                    "Qt5Widgets",
                    "Qt5EventDispatcherSupport",
                    "Qt5FontDatabaseSupport",
                    "Qt5PlatformCompositorSupport",
                    "Qt5ThemeSupport",
                    "qtfreetype",
                    "qtlibpng",
                    "qtpcre2",
                    "qtharfbuzz",
                    "dl",
                    "pthread"
                    

                    Qt configure (static build):

                    ./init-repository &> init_repo.log && ./configure -debug -static -static-runtime -opensource -confirm-license -platform linux-g++-32 -qt-zlib -qt-libpng -qt-libjpeg -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -nomake examples -nomake tests -prefix "/usr/local/Qt_binary/5.15.0-gcc-static_x86/Debug" &> configure.log && sudo make -j 6 &> build.log
                    
                    1 Reply Last reply
                    0
                    • Christian EhrlicherC Offline
                      Christian EhrlicherC Offline
                      Christian Ehrlicher
                      Lifetime Qt Champion
                      wrote on last edited by
                      #11

                      Sorry I don't know how to use premake and how to make sure there that the correct qmake executable and static Qt libs are used.

                      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                      Visit the Qt Academy at https://academy.qt.io/catalog

                      C 1 Reply Last reply
                      0
                      • Christian EhrlicherC Christian Ehrlicher

                        Sorry I don't know how to use premake and how to make sure there that the correct qmake executable and static Qt libs are used.

                        C Offline
                        C Offline
                        continue98
                        wrote on last edited by continue98
                        #12

                        @Christian-Ehrlicher The problem is not in the technical part, how to use it in premake. The problem is that I don't know which libraries are still needed (undefined reference).

                        qt_libs = { 
                        	"Qt5Core", 
                        	"Qt5Gui",
                        	"Qt5Widgets",
                        	"Qt5EventDispatcherSupport",
                        	"Qt5FontDatabaseSupport",
                        	"Qt5WindowsUIAutomationSupport", // analog for Linux?
                        	"Qt5PlatformCompositorSupport",
                        	"Qt5ThemeSupport",
                        	"qtfreetype",
                        	"qtmain", // analog for Linux? 
                        	"qtlibpng",
                        	"qtpcre2",
                        	"qwindows", // analog for Linux?
                        	"qtharfbuzz"
                        }
                        links { qt_libs }
                        

                        Everything links perfectly and works (Windows 10), but Linux needs some other libraries and there is no difference at all what you use for the build system (cmake, premake, etc..). It forces GCC to link it with the -l flag anyway.

                        LIBS += -lQt5Core -lQt5Gui -lQt5Widgets -lQt5EventDispatcherSupport -lQt5FontDatabaseSupport -lQt5PlatformCompositorSupport -lQt5ThemeSupport -lqtfreetype -lqtlibpng -lqtpcre2 -lqtharfbuzz -ldl -lpthread
                        ALL_LDFLAGS += $(LDFLAGS) -L/usr/local/Qt_binary/5.15.0-gcc-static_x86/Debug/lib -L/usr/local/Qt_binary/5.15.0-gcc-static_x86/Debug/plugins/platforms -L/usr/lib32 -m32 -static -static-libstdc++
                        
                        1 Reply Last reply
                        0
                        • Christian EhrlicherC Offline
                          Christian EhrlicherC Offline
                          Christian Ehrlicher
                          Lifetime Qt Champion
                          wrote on last edited by Christian Ehrlicher
                          #13

                          @continue98 said in What is required for link Widgets?:

                          there is no difference at all what you use for the build system (cmake, premake, etc..)

                          It is - I know that I don't need to add extra libs when Qt is linked statically with cmake or qmake. So in there scripts there must be something which is not added by premake

                          /edit: and as you can see here it looks like even you added Qt5Gui, a symbol from there is not found so it must be something with the build system picking up the wrong libs or similar problems:

                          /home/continue/qt5/qtbase/src/widgets/../../include/QtGui/5.15.0/QtGui/private/../../../../../src/gui/kernel/qguiapplication_p.h:284: undefined reference to `QTouchEvent::TouchPoint::TouchPoint(QTouchEvent::TouchPoint const&)'

                          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                          Visit the Qt Academy at https://academy.qt.io/catalog

                          C 1 Reply Last reply
                          0
                          • Christian EhrlicherC Christian Ehrlicher

                            @continue98 said in What is required for link Widgets?:

                            there is no difference at all what you use for the build system (cmake, premake, etc..)

                            It is - I know that I don't need to add extra libs when Qt is linked statically with cmake or qmake. So in there scripts there must be something which is not added by premake

                            /edit: and as you can see here it looks like even you added Qt5Gui, a symbol from there is not found so it must be something with the build system picking up the wrong libs or similar problems:

                            /home/continue/qt5/qtbase/src/widgets/../../include/QtGui/5.15.0/QtGui/private/../../../../../src/gui/kernel/qguiapplication_p.h:284: undefined reference to `QTouchEvent::TouchPoint::TouchPoint(QTouchEvent::TouchPoint const&)'

                            C Offline
                            C Offline
                            continue98
                            wrote on last edited by continue98
                            #14

                            @Christian-Ehrlicher

                            Ok. I am enable linksgroup. Linking works now. But some error:

                            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.
                            

                            If add: Q_IMPORT_PLUGIN (QXcbIntegrationPlugin) . Some error:

                            /home/continue/qt5/qtbase/src/plugins/platforms/xcb/qxcbmain.cpp:56: undefined reference to `QXcbIntegration::QXcbIntegration(QStringList const&, int&, char**)'
                            
                            1 Reply Last reply
                            0
                            • Christian EhrlicherC Offline
                              Christian EhrlicherC Offline
                              Christian Ehrlicher
                              Lifetime Qt Champion
                              wrote on last edited by
                              #15

                              @continue98 said in What is required for link Widgets?:

                              QXcbIntegration

                              this is a separate plugin / library which you don't link against as it seems.

                              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                              Visit the Qt Academy at https://academy.qt.io/catalog

                              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