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. Error while trying to create a static version of Qt
Forum Updated to NodeBB v4.3 + New Features

Error while trying to create a static version of Qt

Scheduled Pinned Locked Moved Installation and Deployment
23 Posts 5 Posters 11.8k Views 1 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.
  • P Offline
    P Offline
    Pufo
    wrote on last edited by
    #1

    ./configure worked
    Now i'm trying to make, but i got this error about GTK.

    @ 1.
    In file included from ../../include/QtGui/private/qgtkstyle_p.h:1,
    2.
    from kernel/qguiplatformplugin.cpp:63:
    3.
    ../../include/QtGui/private/../../../src/gui/styles/qgtkstyle_p.h:69: fatal error: gtk/gtk.h: No such file or directory
    4.
    compilation terminated.
    5.
    make[1]: *** [.obj/release-static/qguiplatformplugin.o] Error 1
    6.
    make[1]: Leaving directory `/opt/qtsdk-2010.05/qt/src/gui'
    7.
    make: *** [sub-gui-make_default-ordered] Error 2@

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      Hi Pufo,

      you should provide some more details.
      What is the operation system?
      Do you try to create a cross-compile version?

      How does your configure command line look like?

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • G Offline
        G Offline
        giesbert
        wrote on last edited by
        #3

        Hi Pufo,

        did you download the full source zip file or do you use the sources downloaded by SDK?
        Also, as koahnig said: which OS, compiler, etc.
        what were the parameters of configure?
        did you change some other files of Qt?

        Nokia Certified Qt Specialist.
        Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

        1 Reply Last reply
        0
        • P Offline
          P Offline
          Pufo
          wrote on last edited by
          #4

          I'm using Linux Ubuntu.
          I have Qt Creator installed, and i'm trying to follow this: http://doc.qt.nokia.com/4.5/deployment-x11.html tutorial to release a static linked version of my application.

          The ./configure part went ok.
          Then i've had the problem i've posted earlier, which i've solved it by putting the absolute path to gtk.h in that header.

          Now, i have another problem.

          @In file included from /usr/include/gtk-2.0/gdk/gdk.h:32,
          from /usr/include/gtk-2.0/gtk/gtk.h:32,
          from ../../include/QtGui/private/../../../src/gui/styles/qgtkstyle_p.h:69,
          from ../../include/QtGui/private/qgtkstyle_p.h:1,
          from kernel/qguiplatformplugin.cpp:63:
          /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h:30: fatal error: gio/gio.h: No such file or directory
          compilation terminated.
          make[1]: *** [.obj/release-static/qguiplatformplugin.o] Error 1
          make[1]: Leaving directory `/opt/qtsdk-2010.05/qt/src/gui'
          make: *** [sub-gui-make_default-ordered] Error 2
          @

          This gio.h thing ...

          1 Reply Last reply
          0
          • P Offline
            P Offline
            Pufo
            wrote on last edited by
            #5

            Looks like it doesn't know where to search for glib and related stuff unless i edit the include statements, which is not nice.

            1 Reply Last reply
            0
            • K Offline
              K Offline
              koahnig
              wrote on last edited by
              #6

              Hi Pufo
              it would be good to post the complete configure command as you used.
              If configure runs through does not necessarily mean that all is ok.

              Vote the answer(s) that helped you to solve your issue(s)

              1 Reply Last reply
              0
              • Z Offline
                Z Offline
                ZapB
                wrote on last edited by
                #7

                Also please use the latest SDK. From your paths it look as if you are using 2010.05? You could also try disabling gtk support in Qt if you don't need it for your app(s).

                Nokia Certified Qt Specialist
                Interested in hearing about Qt related work

                1 Reply Last reply
                0
                • P Offline
                  P Offline
                  Pufo
                  wrote on last edited by
                  #8

                  I've just used simple "./configure" with no other parameters.
                  How do i disable GTK ?

                  1 Reply Last reply
                  0
                  • Z Offline
                    Z Offline
                    ZapB
                    wrote on last edited by
                    #9

                    @
                    ./configure -no-gtkstyle -no-glib
                    @

                    Nokia Certified Qt Specialist
                    Interested in hearing about Qt related work

                    1 Reply Last reply
                    0
                    • G Offline
                      G Offline
                      giesbert
                      wrote on last edited by
                      #10

                      [quote author="Pufo" date="1304874586"]I've just used simple "./configure" with no other parameters.
                      How do i disable GTK ?[/quote]

                      without parameters? then it will not be static! static builds needs at least -static

                      Nokia Certified Qt Specialist.
                      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

                      1 Reply Last reply
                      0
                      • G Offline
                        G Offline
                        goetz
                        wrote on last edited by
                        #11

                        And also to repeat just another time (and you didn't answer the respective question):

                        If you compile Qt manually, then please do so with the stand alone framework sources ("Qt download page":http://qt.nokia.com/downloads, go LGPL, Qt: Framework Only on the right side, the introductory paragraph has the links to a zip or a tar.gz).

                        Recompiling from the installed SDK is very known to cause problem, please avoid this!

                        http://www.catb.org/~esr/faqs/smart-questions.html

                        1 Reply Last reply
                        0
                        • P Offline
                          P Offline
                          Pufo
                          wrote on last edited by
                          #12

                          Sorry guys, i've used @./configure -static -prefix /path/toQt@

                          Is it me or this library thing is harder than programming itself ?

                          1 Reply Last reply
                          0
                          • K Offline
                            K Offline
                            koahnig
                            wrote on last edited by
                            #13

                            [quote author="Volker" date="1304875302"]And also to repeat just another time (and you didn't answer the respective question):

                            If you compile Qt manually, then please do so with the stand alone framework sources ("Qt download page":http://qt.nokia.com/downloads, go LGPL, Qt: Framework Only on the right side, the introductory paragraph has the links to a zip or a tar.gz).

                            Recompiling from the installed SDK is very known to cause problem, please avoid this![/quote]

                            Hi Pufo, recompiling is typically not a major issue. However, you might want to follow Volker's advice.

                            Vote the answer(s) that helped you to solve your issue(s)

                            1 Reply Last reply
                            0
                            • G Offline
                              G Offline
                              goetz
                              wrote on last edited by
                              #14

                              [quote author="Pufo" date="1304880968"]Sorry guys, i've used @./configure -static -prefix /path/toQt@

                              Is it me or this library thing is harder than programming itself ?[/quote]

                              Static compilation in a Linux/Mac environment should be seamless. I do it regularly without any problems from the source package.

                              http://www.catb.org/~esr/faqs/smart-questions.html

                              1 Reply Last reply
                              0
                              • P Offline
                                P Offline
                                Pufo
                                wrote on last edited by
                                #15

                                Yes ! It worked GREAT using Volker's advice.
                                My binary is 14 MB and in ldd the Qt libraries aren't listed anymore.

                                Another question:

                                What is the best choice to distribuite the software, now that i've compiled it?
                                Should i create a .deb pack ?
                                If i've compiled on my Ubuntu machine ( 2.6.35-22-generic ) someone with Slackware or another distribution would be able to run it ?

                                1 Reply Last reply
                                0
                                • G Offline
                                  G Offline
                                  goetz
                                  wrote on last edited by
                                  #16

                                  A Debian package (.deb) is the most convenient for all the users with native .deb support. As far as I know there are converters for the various package formats (deb, rpm, dunno what Slackware uses nowadays).

                                  I personally would go with a .deb, maybe a .rpm and a zip file as fallback option.

                                  http://www.catb.org/~esr/faqs/smart-questions.html

                                  1 Reply Last reply
                                  0
                                  • P Offline
                                    P Offline
                                    Pufo
                                    wrote on last edited by
                                    #17

                                    I've built a static release 10 days ago, but i don't remember how i did it.
                                    I remember i've followed this tutorial: http://doc.qt.nokia.com/latest/deployment-x11.html
                                    Now, if i run: qmake -config release i get the qmake help

                                    1 Reply Last reply
                                    0
                                    • K Offline
                                      K Offline
                                      koahnig
                                      wrote on last edited by
                                      #18

                                      Hi Pufo,
                                      @
                                      qmake -config release
                                      @
                                      is for building your application after you have built your static libs.

                                      If you like to build the static libs you probably should start with a fresh copy of the source. Then you need to start with
                                      @
                                      ./configure -static -prefix /path/to/Qt <other parameters>
                                      @

                                      Vote the answer(s) that helped you to solve your issue(s)

                                      1 Reply Last reply
                                      0
                                      • P Offline
                                        P Offline
                                        Pufo
                                        wrote on last edited by
                                        #19

                                        I've already build my static libs.
                                        How to i use them ?
                                        I've used them once, 10 days ago, but i don't know how.
                                        qmake -config release - works if i run it from sources directory ( earlier i was in build folder )

                                        I've also put CONFIG +=static in my .pro file.
                                        All this happens on Linux.

                                        Also, i'm trying to compile on Windows.
                                        Same story there too.

                                        1 Reply Last reply
                                        0
                                        • K Offline
                                          K Offline
                                          koahnig
                                          wrote on last edited by
                                          #20

                                          In which directory do you have Qt installed?

                                          Vote the answer(s) that helped you to solve your issue(s)

                                          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