Results 1 to 5 of 5

Thread: Static Build Issue on QT 5.15.0

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2020
    Posts
    1
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Exclamation Static Build Issue on QT 5.15.0

    Hi Team,

    We are building QT for static build. We have a licensed perpetual software but our support got expired recently.

    We have followed below link for configuring QT for static.
    https://wiki.qt.io/Building_a_static...ws_using_MinGW

    But we are getting attached error
    Error 1:
    "mimetypes\qmimeprovider.cpp:632:30: error: 'mimetype_database' was not declared in this scope
    Q_STATIC_ASSERT_X(sizeof(mimetype_database), "Bundled MIME database is empty");"
    Error 2:
    "mimetypes\qmimeprovider.cpp:633:52: error: 'MimeTypeDatabaseOriginalSize' was not declared in this scope
    Q_STATIC_ASSERT_X(sizeof(mimetype_database) <= MimeTypeDatabaseOriginalSize,"

    Please help us out on this issue ASAP.

    Thanks,
    raj
    Attached Files Attached Files

  2. #2
    Join Date
    Feb 2021
    Posts
    2
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Static Build Issue on QT 5.15.0

    Hi there!

    I also got this error just now when trying to compile a Windows 32-bit static build of Qt 5.15.2 using MinGW.
    Sorry to see there is no solution for this issue posted here yet. Please @rajganesh report if you
    have found a solution. I'm unable to deploy dynamic Qt because there will be some strange runtime linking errors.
    Static is much more reliable and care free to deploy and I have always used static builds successfully with Qt 3 and Qt 4.

    Thanks, Tom

  3. #3
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,246
    Thanks
    304
    Thanked 866 Times in 853 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Static Build Issue on QT 5.15.0

    I'm unable to deploy dynamic Qt because there will be some strange runtime linking errors.
    Only if you make mistakes in your compilation, linking, and deployment. I have been delivering 32- and 64-bit Qt-based, dynamically-linked apps for over 10 years without problems.

    If your build configuration is wrong and you are compiling and linking against a different version of Qt and/or MSVC than you are using for deployment or you are mixing and matching Debug and Release DLLs, then you are very likely to get DLL errors. If everything is consistent, then there should be no runtime problems.
    <=== 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.

  4. #4
    Join Date
    Feb 2021
    Posts
    2
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Static Build Issue on QT 5.15.0

    My problem was simple. In the build process there was the call to cmd /c mimetypes\mime\generate.bat which generates the qmimeprovider_database.cpp
    That failed because the PowerShell ExecutionPolicy was restricting executions. That bat script could be manually run for both debug and release but then there was other scripts that failed. So I temporarily disabled the PowerShell restrictions and the compile succeeded.


    Added after 22 minutes:


    Dynamic vs static... Yes previously I have sometimes copied the .dll files from the Qt library together with the dynamic Qt build and it has worked. For some reason now with Qt5 when I did not have a static library and quickly I needed to run my program on another machine this did not work any more. Anyway, the library is updated so frequently that the odds that two Qt programs will have the same dll versions is getting so small that a static build will occupy less space on the disk. It is crazy thinking that a simple win32 hello world static Qt5 application takes 18 MB and needs more that 10 floppy disks to be distributed. A few years ago I was making a much more advanced win32 applications with same look & feel, using Borland C++ Builder, and those would take 100kb disk space and you could fit 10 such programs on a floppy disk.
    Last edited by QTom; 15th February 2021 at 08:50.

  5. #5
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,246
    Thanks
    304
    Thanked 866 Times in 853 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Static Build Issue on QT 5.15.0

    Yes previously I have sometimes copied the .dll files from the Qt library together with the dynamic Qt build and it has worked.
    Are you aware that Qt comes with a deployment tool that identifies the DLLs required for a dynamically-linked distribution?

    with Qt5 ... this did not work any more.
    Because in Qt5, the dependence on the underlying OS and GUI system was refactored, which resulted in a different directory structure required for the installation of the executable. An install now requires a "platforms" subdirectory under the directory for the executable that contains the platform-specific DLL, in this case "qwindows.dll". If you have other plugins, like database drivers, these have to go into a "plugins" subdirectory, and so forth.

    From what I read of Qt6, more refactoring has occurred with respect to the platform's graphics system, but i do not know if this has changed the deployment requirements. Likely there are more platform-specific DLLs required.

    a simple win32 hello world static Qt5 application takes 18 MB
    A dynamically-linked Qt5 Windows app takes the same. Qt5Core, Qt5Gui, Qt5Widgets, and qwindows DLLs add up to 18 MB. Apparently your linker drags in the entire static library regardless of how much of it your app actually uses.

    and needs more that 10 floppy disks to be distributed.
    Ummm, there are these new shiny things called "CDs" and "DVDs" that companies use to distribute software now. Some of them are even using this invisible thing called "the Internet", which sort of works like Compuserve, except without wires or a 1200 baud modem. You should look into it.
    <=== 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. Issue with icons and static build
    By ceraolo in forum Installation and Deployment
    Replies: 3
    Last Post: 10th April 2014, 08:53
  2. Build static QT + static SSL problem.
    By makzimi in forum Qt Programming
    Replies: 3
    Last Post: 24th April 2012, 00:45
  3. Replies: 3
    Last Post: 1st June 2011, 16:32
  4. Replies: 1
    Last Post: 14th January 2010, 00:35
  5. Moving from QT 4.5 shared build to QT 4.5.2 static build
    By extrakun in forum Qt Programming
    Replies: 0
    Last Post: 26th October 2009, 10:49

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.