It is necessary to statically build the necessary Qt5.8 libraries in the project. Project-> Project Properties-> C / C ++ -> Code Generation-> The runtime library is changed from MD to MT (Debug or Release is not important). Build errors Changed the parameter / NODEFAULTLIB in the properties of the project-> linker, but there even more errors appeared. I was looking for other solutions to a similar problem, but everywhere I suggest changing the Runtime Library on MT for static linking (which I did myself). And this problem is only for 1 file (With the rest of such garbage does not occur).

  • qt is compiled by default with support for dynamic linking. If you need static linking - you need to buy a license (as far as I know) - KoVadim
  • I also read about it, but I'm not sure that there is no other way out. - MrBin

1 answer 1

By changing the /MD flag to /MT , you only change the layout of the MSVC Runtime , not Qt . To compile statically Qt , it needs to be recompiled. To do this, the configuration will need to specify the -static key.

But keep in mind that the license, under which Qt ( LGPL ) is distributed, in the case of static linking requires the fulfillment of one of the following conditions:

  • the application must be licensed under the GPL / LGPL ;

  • Application object code must be provided so that the application can be self-referenced.


PS By the way, if Qt is compiled with /MD (by default), and an application with /MT , then hard-to-detect errors are possible. M $ does not recommend this.

  • Thanks, I will try. - MrBin