May 8, 2011

Pufo Pufo
Lab Rat
19 posts

Error while trying to create a static version of Qt

Page  
1

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

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

22 replies

May 8, 2011

koahnig koahnig
Mad Scientist
2101 posts

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?

May 8, 2011

Gerolf Gerolf
Area 51 Engineer
3210 posts

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?

 Signature 

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

May 8, 2011

Pufo Pufo
Lab Rat
19 posts

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.

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

This gio.h thing …

May 8, 2011

Pufo Pufo
Lab Rat
19 posts

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

May 8, 2011

koahnig koahnig
Mad Scientist
2101 posts

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.

May 8, 2011

ZapB ZapB
Robot Herder
1354 posts

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).

 Signature 

Nokia Certified Qt Specialist
Interested in hearing about Qt related work

May 8, 2011

Pufo Pufo
Lab Rat
19 posts

I’ve just used simple “./configure” with no other parameters.
How do i disable GTK ?

May 8, 2011

ZapB ZapB
Robot Herder
1354 posts

  1. ./configure -no-gtkstyle -no-glib

 Signature 

Nokia Certified Qt Specialist
Interested in hearing about Qt related work

May 8, 2011

Gerolf Gerolf
Area 51 Engineer
3210 posts
Pufo wrote:
I’ve just used simple “./configure” with no other parameters. How do i disable GTK ?

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

 Signature 

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

May 8, 2011

Volker Volker
Robot Herder
5428 posts

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 [qt.nokia.com], 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!

May 8, 2011

Pufo Pufo
Lab Rat
19 posts

Sorry guys, i’ve used

  1. ./configure -static -prefix /path/toQt

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

May 8, 2011

koahnig koahnig
Mad Scientist
2101 posts

Volker wrote:
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 [qt.nokia.com], 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!

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

May 8, 2011

Volker Volker
Robot Herder
5428 posts

Pufo wrote:
Sorry guys, i’ve used
  1. ./configure -static -prefix /path/toQt

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

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

May 8, 2011

Pufo Pufo
Lab Rat
19 posts

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 ?

May 8, 2011

Volker Volker
Robot Herder
5428 posts

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.

Page  
1

  ‹‹ [closed] sdk 1.1 bombs on perl      devices.xml missing ››

You must log in to post a reply. Not a member yet? Register here!