A
A
Andrey PINEAPPLE2016-07-07 17:53:00
Qt
Andrey PINEAPPLE, 2016-07-07 17:53:00

How to make Qt static?

The application built on Qt5.5.1 MinGW does not start
0638d8e823ce4d3b83456d7acfd8bb00.png
As I understand it, you need to make Qt static.
1. How to do it?
2. Why is this required at all?

So I don’t understand in any way, was it really impossible to initially do so that there would be no this hemorrhoids, or am I not understanding something?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
F
Fat Lorrie, 2016-07-07
@AndreyHudz90

Platinum issue.
This can be done by building Qt from source with the necessary configuration keys. There are many guides on the web .
This is not required in the general case. You just need to build the binary versions of the libraries (dll) in a folder next to your executable (one of them is the Qt5Widgets.dll module that the error tells you about). This is dynamic linking of libraries.
For convenience, you can always use windeployqt (for Windows), which will collect all the necessary files in one place, or simply by finding and adding them manually (by analyzing the process dependencies under debugging in the IDE using Process Explorer or a special utility - DependencyWalker )
So that all the necessary Qt modules "compiled" into your executable ( staticlinking), you need to build a version of Qt that supports this (but it is not distributed as a ready-made binary package, therefore from the sources).
Well, static linking, ceteris paribus, violates the Qt community license if you do not distribute open source code with the program (you need to allow the user to replace the Qt version dynamically, or build the program with it again).

J
Jacob E, 2016-07-07
@Zifix

You don't understand something. You don't understand what a library is, how a linker works. Learn materiel.
Hint: windeployqt

R
Rou1997, 2016-07-07
@Rou1997

You don’t need static ones, it’s easier to add all the necessary libraries to the directory of the EXE file, first DependencyWalker for regular dependencies, there are Qt libraries, and also Microsoft Visual C ++ or GCC, then deal with dependencies that are loaded on the fly, for example, plugins, so that determine which plug-ins are needed, rename (delete) your C: \ Qt folder, and finally, on a "clean" computer, check, say for networks, if SSL (HTTPS, SMTP), then a couple more specials. libraries are needed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question