【发布时间】:2022-08-19 01:14:10
【问题描述】:
我在 Windows 10 上安装了 QT 6.2.2,并且正在尝试构建 qwt 6.2.0。通过 qwt 库的 MSVC 编译成功,但在编译 qwt 示例时,nmake 会输出链接器错误。我试图通过 QT MSVC 命令提示符编译所有 qwt,方法是从 MSVC 加载 vcvars,运行 qmake,然后按照此处的说明运行 nmake (https://qwt.sourceforge.io/qwtinstall.html#BUILDSUBSECTION)。
nmake 的输出在这里:
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.
我已经在两台不同的 Windows 10 机器上试过这个,并且在两台机器上都遇到了同样的问题。
-
为这个特定示例(animation.exe)生成的 Makefile 确实在 LFLAGS 中包含 /SUBSYSTEM:WINDOWS ——它还需要这个入口模块吗?
-
在我提供的链接中,我正在使用开发人员为他们自己的软件推荐的构建系统。只是试图解决编译失败。如果我加载项目并在 QtCreator 中构建它,它会出现相同的链接器错误。
标签: qt visual-c++ qwt