[Interest] Tweaking a static build of Qt 6 for Windows

Cristian Adam cristian.adam at qt.io
Wed Feb 1 12:10:55 CET 2023


All the missing __imp symbols mean that you are trying to link to a shared library.

$ configure --help | findstr static
                         sections. [auto for static builds, otherwise no]
  -static .............. Build static Qt libraries [no] (yes for UIKit)
  -static-runtime ...... With -static, use static runtime [no] (Windows only)
                         benchmarks, manual-tests, minimal-static-tests)

Make sure you pass both -static and -static-runtime to your Qt configuration. -static-runtime will get you /MT for cl.exe


From: Interest <interest-bounces at qt-project.org> on behalf of Nuno Santos <nuno.santos at imaginando.pt>
Sent: Wednesday, February 1, 2023 11:07
To: Macieira, Thiago <thiago.macieira at intel.com>
Cc: Qt Interest <interest at qt-project.org>
Subject: Re: [Interest] Tweaking a static build of Qt 6 for Windows


Right now my problem is that the static build of Qt is unable to compile successfully my project and I don’t understand why.

The static build of Qt does not have this problem on Mac.

Any ideas?




[cid:98fbc6ca-f9b8-4575-9458-99d4c86d8de2 at eurprd02.prod.outlook.com]

> On 30 Jan 2023, at 18:34, Thiago Macieira <thiago.macieira at intel.com> wrote:
> On Monday, 30 January 2023 10:13:49 PST Nuno Santos wrote:
>> Thiago,
>> Thanks for your reply.
>> I’m not very technical about this details like yourself. I’ve been doing
>> this since ever. To reconsider I need to better understand the reasons.
> Sure.
>> The thing is. I need to have Qt compiled with MT instead of MD other wise I
>> can’t open two instances of my plugins on the same host. Also, I don’t want
>> to bundle MSVC runtimes. That sucks.
> You can open multiple plugins in the same process just fine and you don't have
> to ship the runtime if it's already installed. It's already installed on
> Windows 10.
>> So… are those files still being taking into account when building Qt, even
>> that Qt is now built by cmake?
> Static runtime builds still exist, but I have no idea if they are tested or
> work. I recommend you reconsider your needs.
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>  Cloud Software Architect - Intel DCAI Cloud Engineering
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> https://lists.qt-project.org/listinfo/interest

Interest mailing list
Interest at qt-project.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20230201/a13d7f6e/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: linking errors.jpg
Type: image/jpeg
Size: 431395 bytes
Desc: linking errors.jpg
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20230201/a13d7f6e/attachment-0001.jpg>

More information about the Interest mailing list