Results 1 to 7 of 7

Thread: Building applications statically in Qt

  1. #1
    Join Date
    Apr 2012
    Posts
    5
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Building applications statically in Qt

    Hi,

    I am new to Qt programming and I am using Qt Creator 2.2.1 Based on Qt 4.7.3 (Running on Ubuntu 11.10) I wanted to build an application to run on an Ubuntu system without Qt installed and so decided to go for a static build. I followed the instructions in "http://www.qtcentre.org/wiki/index.php?title=Building_static_Qt_on_Linux"

    I ran all the commands and everything but the problem now is when i try to add the new qmake to my Qt versions (in Tools-> Options) it says "Qt version not installed properly". How do I go about this ?

    I am also kinda new to Linux OS as well.

    Any help will be appreciated.

    Thanks

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Building applications statically in Qt

    Are you trying to point Qt Creator at the copy of qmake installed under your install prefix when you ran "make install" (correct), or the copy of qmake in the build area (incorrect)?

  3. The following user says thank you to ChrisW67 for this useful post:

    mathewjmanavalan (26th April 2012)

  4. #3
    Join Date
    Apr 2012
    Posts
    5
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Building applications statically in Qt

    Hey,

    So the thing was the instructions i followed for compiling the static library was wrong. Slight different in the commands, made a big difference. Now its working fine and I was able to create a statically linked app. Thanks for the instruction

    Now the problem I am facing is with the UI looking very ugly with the static version. Not much help found on the forums too. Would be very grateful if someone could point me in the right direction.

    Thanks

  5. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Building applications statically in Qt

    Which part of these instructions is wrong?
    Qt 4.3.x and Later

    type:
    ./configure -static -nomake demos -nomake examples -nomake tools
    make
    make install
    There's not a lot of scope to get that wrong, especially given they are variation on what is in the official docs.

  6. The following user says thank you to ChrisW67 for this useful post:

    mathewjmanavalan (3rd July 2012)

  7. #5
    Join Date
    Apr 2012
    Posts
    5
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Building applications statically in Qt

    So those instructions worked eventually. Like i said now the only problem is that the statically built version looks (the UI) ugly. Like old Windows 95 kinda look. Dont know how to fix it.

  8. #6
    Join Date
    Nov 2007
    Posts
    36
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Building applications statically in Qt

    I recommend you cmake Wonderful!

  9. #7
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Building applications statically in Qt

    I recommend you cmake Wonderful!
    How is that relevant? ... unless you have ported the Qt library build to CMake in which case you should contribute it to the project.


    The ugly UI could be because there is still a missing dependency: perhaps FreeType. Try running ldd against your compiled application.

Similar Threads

  1. building qt statically help
    By terhje in forum Installation and Deployment
    Replies: 1
    Last Post: 25th July 2011, 04:11
  2. LNK2005 error in VS2005 when statically building Qt App
    By pkloc in forum General Programming
    Replies: 9
    Last Post: 2nd July 2011, 01:36
  3. building qt statically on Mac OSX
    By aarti.nagpal in forum Installation and Deployment
    Replies: 0
    Last Post: 4th February 2011, 09:32
  4. building qt statically for windows mobile
    By bullwinkle in forum Newbie
    Replies: 0
    Last Post: 28th January 2010, 09:02
  5. building qt statically
    By eleanor in forum Installation and Deployment
    Replies: 7
    Last Post: 9th May 2009, 09:03

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.