[英]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.