0

I have QT 6.2.2 installed on Windows 10 and am trying to build qwt 6.2.0. Compilation via MSVC of the qwt library is successful but nmake outputs linker errors when compiling the qwt examples. I am attempting to compile all of qwt via the QT MSVC command prompt by loading vcvars from MSVC, running qmake, then running nmake as instructed here (https://qwt.sourceforge.io/qwtinstall.html#BUILDSUBSECTION).

The output of nmake is here:

Microsoft (R) Program Maintenance Utility Version 14.30.30706.0
Copyright (C) Microsoft Corporation.  All rights reserved.

linking ..\bin\animation.exe
MSVCRT.lib(exe_winmain.obj) : error LNK2019: unresolved external symbol WinMain referenced in function "int __cdecl __scrt_common_main_seh(void)" (?__scrt_common_main_seh@@YAHXZ)
..\bin\animation.exe : fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: 'echo' : return code '0x460'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\bin\HostX64\x64\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.

I've tried this on two different windows 10 machines and run into the same problem on both machines.

funwound
  • 1
  • 1
  • Possible dupe of https://stackoverflow.com/questions/64993943/what-where-is-scrt-common-main-seh – chehrlic Jan 07 '22 at 19:26
  • The generated Makefile for this specific example (animation.exe) does contain /SUBSYSTEM:WINDOWS in the LFLAGS -- would it still need this entry mod? – funwound Jan 07 '22 at 19:57
  • I'm using the build system recommended by the developer for their own software in the link I provided. Just trying to troubleshoot the compilation failure. If I load the project and build it in QtCreator it has the same linker error. – funwound Jan 08 '22 at 19:22

1 Answers1

0

Ran into the exact same problem yesterday. Found a solution (probably not the cleanest oen)

Edit every Makefile.Debug & Makefile.Release for the examples that raise that error. at the end of the LFLAGS line, add "/ENTRY:mainCRTStartup".

Solution comes from: error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup

There is probably a smarter solution than editing so many files...