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

Nuno Santos nuno.santos at imaginando.pt
Wed Feb 1 13:33:26 CET 2023


Cristian,

Thank you very much for your feedback. It worked like charm. Standalone application is now building and running.

I’m just having a new problem with the plugin version of the application that did not used to happen in Qt 5:

C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winnt.h:173: error: C1189: #error:  "No Target Architecture"

//
// Note: RC_INVOKED is checked in PROBE_ALIGNMENT to maintain compatibility with previous
//       versions of the SDK which did not block inclusion in an .RC file.
//

#if defined(_AMD64_) || defined(_X86_)
#define PROBE_ALIGNMENT( _s ) TYPE_ALIGNMENT( DWORD )
#elif defined(_IA64_) || defined(_ARM_) || defined(_ARM64_)

//
// TODO: WOWXX - Unblock ARM. Make all alignment checks DWORD for now.
//

#define PROBE_ALIGNMENT( _s ) TYPE_ALIGNMENT( DWORD )
#elif !defined(RC_INVOKED)
#error "No Target Architecture"
#endif

I’m not including winnt.h anywhere in my code.

Do you have any idea of what might be going on?

Thanks!

Regards,

Nuno


> On 1 Feb 2023, at 11:10, Cristian Adam <cristian.adam at qt.io> wrote:
> 
> Hi,
> 
> All the missing __imp symbols mean that you are trying to link to a shared library.
> 
> C:\Projects\Qt\repo\qtbase
> $ 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
> 
> Cheers,
> Cristian.
> 
> 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
>  
> Thiago,
> 
> 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?
> 
> Thanks!
> 
> Best,
> 
> Nuno
> 
> <linking errors.jpg>
> 
> 
> > 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 <mailto:Interest at qt-project.org>
> https://lists.qt-project.org/listinfo/interest

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20230201/a5fa377a/attachment.htm>


More information about the Interest mailing list