简体   繁体   English

QT Windows桌面GUI程序在发布模式下崩溃,但在调试模式下不崩溃

[英]QT Windows Desktop GUI program crashes in Release mode but does not crash in Debug mode

I have this strange problem where running the release version of my GUI app on Windows crashes at startup and prints out the following (abridged) output: 我遇到了一个奇怪的问题,即在Windows上运行我的GUI应用程序的发行版时,在启动时崩溃并打印出以下(摘要)输出:

Starting C:........\build-WindowsUI-Desktop_Qt_5_4_0_MSVC2010_OpenGL_32bit-Release\release\WindowsUI.exe...
The program has unexpectedly finished.
C:.............\build-WindowsUI-Desktop_Qt_5_4_0_MSVC2010_OpenGL_32bit-Release\release\WindowsUI.exe crashed

There is no other information given. 没有提供其他信息。 Compiler output seems normal and no crash detailed information is printed. 编译器输出似乎正常,并且没有打印任何崩溃详细信息。 When I run the debug version: everything is fine. 当我运行调试版本时:一切都很好。 The GUI runs normally and no problems encountered. GUI正常运行,没有遇到问题。

Has anyone else encountered something like this before? 有人遇到过类似的事情吗? I'm stuck here. 我被困在这里。

Thank you Mailerdaimon! 谢谢Mailerdaimon!

I took at look at my QT project file. 我看了看我的QT项目文件。 In my .pro file I tell the linker to use specific dlls for release and debug mode. 在我的.pro文件中,我告诉链接器将特定的dll用于发布和调试模式。 Based on your idea, I tried commenting out the sections that specify the dlls based on which type of executable was being outputted: 根据您的想法,我尝试注释掉根据输出的可执行文件类型指定dll的部分:

#win32|win64:debug {
# need to link DLL versions of library for Debug
#LIBS += -L"../ThirdParty/thirdPartyDlls" \
#
#         -lthirdPartyD
#
#}

#win32|win64:release {
# need to link DLL versions of  library for release
LIBS += -L"../ThirdParty/thirdPartyDlls" \

         -lthirdParty

#}

And now release mode works! 现在发布模式有效! I guess I used the wrong syntax in the .pro file or maybe it's a bug in Qt Creator. 我猜我在.pro文件中使用了错误的语法,或者可能是Qt Creator中的错误。 Either way I got it working now :). 无论哪种方式,我现在都可以正常工作:)。 Thanks again! 再次感谢!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 相对文件路径的差异:Qt Creator的调试模式和发布模式 - Difference in relative file path: debug mode and release mode of Qt Creator QPainter :: begin在调试模式下使程序崩溃 - QPainter::begin crashes the program in debug mode 发布模式与MS Visual Studio Windows中的DEbug模式相同 - Release mode Vs DEbug mode in MS Visual Studio Windows Qt项目文件无法在Windows上的发布模式下干净地重新编译 - Qt project file fails to cleanly recompile in release mode on windows 如何在调试模式下启用控制台 window 并使用 QT 和 CMake 在发布模式下禁用? - How to enable console window in Debug mode and disable in Release mode with QT & CMake? 任务栏图标在调试模式下工作,而不在发布模式下工作 - Tray Icon is working in Debug Mode, Not in Release Mode 仅仅因为程序具有GUI,是否就意味着它会在Windows docker中崩溃? - Just because a program has a GUI does it mean it will crash in windows docker? SetWindowsHookEx注入在发布模式下失败,但在调试模式下工作 - SetWindowsHookEx injection failed on release mode but worked on debug mode Qt创建者调试模式真的很慢 - Qt creator debug mode is really slow 在Windows 8应用程序模式而非桌面模式下打开IE URL - Open IE URL in windows 8 app mode NOT desktop mode
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM