导入 qt 应用程序时出现 Visual Studio-link 错误

发布于 2024-12-27 13:04:31 字数 548 浏览 0 评论 0原文

我曾经在 Visual Studio 2010 上使用命令提示符使用 qmake 构建 Qt 应用程序。但是,我最近安装了 Qt Visual Studio 插件,并从 Visual Studio 上的 .pro 文件导入了 qt 应用程序,以便能够进行编程与IDE。

但是,当我尝试构建应用程序时,我收到以下消息:

MSVCRTD.lib(crtexew.obj):错误 LNK2019:函数 __tmainCRTStartup 中引用了无法解析的外部符号 WinMain

我知道有人说这是选择 Windows (/SUBSYSTEM:WINDOWS) 或 Console ( /SUBSYSTEM:CONSOLE) 在项目的链接器属性中。然而,这两种选择都不能解决问题。我的 Qt 应用程序使用 GUI 和控制台(我在 .pro 文件中设置 CONFIG += console)。

如果您能给我解决这个问题的建议,我将不胜感激。

非常感谢,

大辅

I used to build a Qt application with qmake using command prompt on visual studio 2010. But, I have recently installed Qt Visual Studio add-in and have imported a qt application from .pro file on visual studio, in order to be able to programm with IDE.

However, when I try to build the application, I get the following message:

MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol WinMain referenced in function __tmainCRTStartup

I know it has been said that this is a matter of choosing Windows (/SUBSYSTEM:WINDOWS) or Console (/SUBSYSTEM:CONSOLE) in the linker property of the project. However, neither option solves the problem. My Qt application uses GUI and also conole (I set CONFIG += console in .pro file).

I would appreciate if you could give me a suggestion to solve this issue.

Thanks a lot,

Daisuke

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

半葬歌 2025-01-03 13:04:31

问题解决了。我只需要摆脱 Windows::...“链接器”-“命令行”中的附加选项,并在“链接器”-“系统”中选择控制台

The problem is solved. I just needed to get rid of Windows::... additional option in "Linker"-"Command Line" and choose console in "Linker"-"System"

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文