Results 1 to 10 of 10

Thread: Deploying Qt application on Linux Ubantu OS

  1. #1
    Join Date
    Jul 2012
    Location
    India
    Posts
    33
    Thanks
    10
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Deploying Qt application on Linux Ubantu OS

    Hi,
    I am developing a Qt application for Linux Ubuntu OS using Qt creator. Now I need to deploy this on my client machine. My client system is not having any Qt framework installed. I need to include the necessary Qt libraries with my application. I used dynamic linking method for including Qt library.

    How I can possible to make my application working without Installing the Qt framework from the Internet. I need to make this like windows Qt deployment(Including dependency dll files with the application).

    (Simply I need to copy paste the necessary dependency files from development machine to client system)

    Is it possible to make such a deployment in Linux(Ubuntu) OS and How I can do this ?


    Many Thanks.....................
    Last edited by arunkumaraymuo1; 10th December 2012 at 04:53.

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

    Default Re: Deploying Qt application on Linux Ubantu OS

    Yes it is possible. You start by reading the Deploying an Application on X11 Platforms documentation.

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

    arunkumaraymuo1 (13th December 2012)

  4. #3
    Join Date
    Mar 2011
    Location
    Coimbatore,TamilNadu,India
    Posts
    379
    Thanks
    10
    Thanked 13 Times in 12 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Deploying Qt application on Linux Ubantu OS

    Try with static building:

    1. Install QtSDK (2009.05)

    2. Open your mkspecswin32-g++qmake.conf file (located in C:\Qt\2009.05\qt\mkspecs\win32-g++\qmake.conf) in an editor like notepad.

    3. Find the line that starts with "QMAKE_LFLAGS = -enable-stdcall-fixup..." and ddd the phrase "-static" (without quotes) after the "=" sign and before the "-enable..." phrase, so it looks like:
    QMAKE_LFLAGS = -static -enable-stdcall...

    4. Save and close this file.

    5. Set your environment variables. Right-click Computer >> Properties >> Advanced System Settings >> Click the "Environment Variables..." button.

    6. Under "User variables," make sure QTDIR is set to your Qt path (C:\Qt\2009.05\qt). Make sure QMAKESPEC is set to win32-g++.

    7. Under "System variables," edit the one called "Path." Add a semicolon ( ; ) to the end, and add the following:
    C:\Qt\2009.05\mingw\lib;C:\Qt\2009.05\mingw\bin;C: \Qt\2009.05\qt\bin

    8. When finished, relog or reboot.

    9. Open a command prompt.

    10. Change to your Qt directory by entering: cd C:\Qt\2009.05\qt

    11. Enter the following: configure -static -no-phonon -no-phonon-backend -release -no-exceptions

    12. When it asks which edition you want to use, enter "o" for open source.

    13. When it asks you to accept the terms of the license, enter "y" for yes. This will take around maybe 10 minutes to complete.

    14. When that finishes, enter the following: mingw32-make sub-src (or) nmake sub-src

    15. Go out to dinner, this will take a while (took between 1-2 hours for me).

    16. When this finishes, open your project in the Qt Creator.

    17. Double-click the project (.pro) file to open it in edit mode.

    18. Add the following line: CONFIG += static

    19. qmake Hello.pro
    nmake release (or) mingw32-make release

    20. Navigate to your release directory and voila! Your standalone executable should be there.

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

    Default Re: Deploying Qt application on Linux Ubantu OS

    The OP was not asking for a static executable... they specifically said they had a dynamically linked Qt executable. The solution to that problem is a simple wrapper script (provided in the docs I linked), not to throw the whole thing away and start again.

    There's a documented method for building a static Qt library, it doesn't involve hacking the files in mkspecs, and it still only partly addresses the desire for a single executable. This is not a slam-dunk solution to the OP's request, even if they had asked for it.

  6. #5
    Join Date
    Oct 2012
    Posts
    16
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Deploying Qt application on Linux Ubantu OS

    Follow the attached instructions found at this URL.

    http://tldp.org/HOWTO/html_single/De...uilding-HOWTO/

    You will end up with a debian package that will install under Ubuntu and install the required additional packages.

  7. #6
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,419
    Thanks
    37
    Thanked 1,545 Times in 1,495 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Deploying Qt application on Linux Ubantu OS

    Quote Originally Posted by ChrisW67 View Post
    The OP was not asking for a static executable... they specifically said they had a dynamically linked Qt executable. The solution to that problem is a simple wrapper script (provided in the docs I linked), not to throw the whole thing away and start again.
    Indeed!

    Not even mentioning all the hassle one has with statically linking Qt, like losing support for plugins, etc.

    Cheers,
    _

  8. #7
    Join Date
    Jul 2012
    Location
    India
    Posts
    33
    Thanks
    10
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Deploying Qt application on Linux Ubantu OS

    But I dont have any license to use the static build of Qt

  9. #8
    Join Date
    Mar 2011
    Location
    Coimbatore,TamilNadu,India
    Posts
    379
    Thanks
    10
    Thanked 13 Times in 12 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Deploying Qt application on Linux Ubantu OS

    Dont use commercial license. Just use the free license.

  10. #9
    Join Date
    Sep 2011
    Posts
    1,245
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Deploying Qt application on Linux Ubantu OS

    Quote Originally Posted by arunkumaraymuo1 View Post
    But I dont have any license to use the static build of Qt
    1) You don't need a commercial license to distribute a statically linked Qt app.
    2) For the hassle involved of meeting the actual license when distributing a statically linked Qt app, you will wish you persevered with shared library deployment.
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  11. #10
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,419
    Thanks
    37
    Thanked 1,545 Times in 1,495 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Deploying Qt application on Linux Ubantu OS

    Quote Originally Posted by arunkumaraymuo1 View Post
    But I dont have any license to use the static build of Qt
    Non-issue, since you don't want to statically link anyway.

    Cheers,
    _

Similar Threads

  1. Replies: 1
    Last Post: 2nd May 2011, 03:29
  2. Issues deploying a Qt-Creator-Project on Linux
    By The_Maverick in forum Installation and Deployment
    Replies: 0
    Last Post: 22nd December 2010, 22:18
  3. Deploying Qt Application under Linux
    By addu in forum Qt Programming
    Replies: 17
    Last Post: 27th November 2010, 04:40
  4. Deploying application on Linux machine without Qt
    By will49 in forum Installation and Deployment
    Replies: 2
    Last Post: 10th July 2008, 22:41
  5. Deploying App on Linux
    By janus in forum Installation and Deployment
    Replies: 5
    Last Post: 6th May 2008, 21:18

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.