[英]Difference in relative file path: debug mode and release mode of Qt Creator
[英]QT Windows Desktop GUI program crashes in Release mode but does not crash in Debug mode
我遇到了一个奇怪的问题,即在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
没有提供其他信息。 编译器输出似乎正常,并且没有打印任何崩溃详细信息。 当我运行调试版本时:一切都很好。 GUI正常运行,没有遇到问题。
有人遇到过类似的事情吗? 我被困在这里。
谢谢Mailerdaimon!
我看了看我的QT项目文件。 在我的.pro文件中,我告诉链接器将特定的dll用于发布和调试模式。 根据您的想法,我尝试注释掉根据输出的可执行文件类型指定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
#}
现在发布模式有效! 我猜我在.pro文件中使用了错误的语法,或者可能是Qt Creator中的错误。 无论哪种方式,我现在都可以正常工作:)。 再次感谢!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.