Results 1 to 5 of 5

Thread: Newbie needs help building a static release program

  1. #1
    Join Date
    Apr 2020
    Posts
    5
    Qt products
    Qt5
    Platforms
    Windows

    Default Newbie needs help building a static release program

    Hi! I have tried twice to start this thread, but maybe my post was too long. In a nutshell, I am a Greenhorn and need help building a static opensource program I can take to my other computer. If this post makes it to the forum, I will submit another one explaining my problems in full.
    OK! I made it! Here's the problem: I began learning how to use Qt about 3 weeks ago, and am a fully self taught hobbyist. I have coded a nice program using Qt Creator, and it works fine. I use v. 5.14.1 with MinGW v. 7.3.0. But now I want to take it to my other computer. So I think I need to do a static build of Qt, and use it to statically compile my program. I tried to follow the instructions I found here: https://wiki.qt.io/Building_a_static...ws_using_MinGW. I modified the script to use this source package: qt-everywhere-src-5.14.1.zip, and the building ended with an error, which I unfortunately did not document. But I have lots of stuff in my C:\Qt\Static older, so I tried anyway, but it doesn't integrate with Qt Creator like the instructions say it should. The instructions seemed to suggest I use a source file named qt-everywhere-opensource-src-5.14.1.7z, but I couldn't find one by that name. So I am wondering how to proceed. I am tempted to just attempt to re-run the static installation script and see if the error persists. But should I remove the Static folder before doing that? Is there a recommended way to remove it? I really like Qt so far, and I hope that I can overcome these problems because I would like to do lots of programs for my own use, using Qt. So I will appreciate any assistance you can provide! Thank you!!!
    Last edited by actor39; 16th April 2020 at 22:18.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,239
    Thanks
    303
    Thanked 865 Times in 852 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Newbie needs help building a static release program

    You do not need to build a static distribution of Qt in order to create programs that can be deployed to PCs without Qt installed. You simply need to deploy whatever shared libraries (DLL on Windoze, .so on linux) and other resources are required to run the program. It is nowhere near as hard as you are trying to make it.

    Read the Qt documentation on deployment and pay special attention to the directory structure needed for things like plugins, database drivers, etc. if you use them.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. #3
    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: Newbie needs help building a static release program

    Welcome actor39

    You do not actually need a static Qt build in order to deploy your application to another machine. The only thing a static build will get you, apart from the effort of building it and limitations it imposes, is a smaller number of files to deploy (maybe as small as one).

    Have you been through this page? https://doc.qt.io/qt-5/windows-deployment.html


    Addendum:
    D'oh! Should have previewed before submitting.

  4. #4
    Join Date
    Apr 2020
    Posts
    5
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Newbie needs help building a static release program

    Thanks to d_stranz and ChrisW67 for your response. Since I am a newbie, I think I will pursue both avenues to Windows deployment, just for the experience and learning opportunity. Since I am so far along this static path, I want to spend a few more days trying it before branching off to the shared libraries process.
    Last night I had another look at the PS script, and I found this reference:
    https://forum.qt.io/topic/88891/prob...e-of-my-builds
    I took the suggestion for modifying the PS script and tried again. This time no error messages have been posted, but the script "hangs". The last line I see is:
    Info: creating stash file C:\Qt\Static\src\qt-everywhere-src-5.14.1\.qmake.stash
    While investigating this problem, I found this reference:
    https://forum.qt.io/topic/104238/con...h-file-forever
    (which I do not understand), and this reference:
    https://stackoverflow.com/questions/...ine-option-c11
    which seems to suggest that in the call to qmake, the "-c++11" flag is at fault. But I have no idea how to "make" the Qt static build except to use the PS script. I suspect that there are some very minor inaccuracies in the PS script due to some system upgrades which have taken place since it was written. In fact, this post suggests that I have found and corrected some of these already. But I have no idea how to produce a 100% correct PS script that will do the static install for me. As mentioned, any assistance will be greatly appreciated!

  5. #5
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,239
    Thanks
    303
    Thanked 865 Times in 852 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Newbie needs help building a static release program

    Apparently you really like doing things in the most difficult way possible. Virtually no one does static deployments of Qt apps. Bulding a static Qt distribution just isn't worth the days of pain. It is far too easy to just bundle the required DLLs, which for a typical Windows GUI app are only 4: Qt5Core, Qt5Gui, Qt5Widgets, and qwindows, and probably the same on linux.

    And as ChrisW67 says, even if you do get a static build, it may not support what your app needs. Some Qt things are only supported with dynamic libraries and AFAIK you can't mix static and dynamic libraries, at least not on Windows.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Newie needs help building a static release program
    By actor39 in forum Installation and Deployment
    Replies: 0
    Last Post: 16th April 2020, 04:12
  2. building a static lib with links to other static libs
    By hubipet in forum Installation and Deployment
    Replies: 0
    Last Post: 20th October 2011, 18:13
  3. Building release in Eclipse
    By StephenR in forum Installation and Deployment
    Replies: 3
    Last Post: 27th August 2009, 09:37
  4. Static vs. Dynamic Building for GPL Open Source Software Release
    By brent99 in forum Installation and Deployment
    Replies: 6
    Last Post: 11th March 2008, 20:46
  5. Building qt program with static library
    By JonathanForQT4 in forum Newbie
    Replies: 2
    Last Post: 22nd June 2007, 23:15

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.