导入 qt 应用程序时出现 Visual Studio-link 错误
我曾经在 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题解决了。我只需要摆脱 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"