首先在官方Qt论坛发帖求助,但未获得回应。
使用Qt Creator 4.2.0(社区版),Windows 7 SP1,MSVC 2013 64位。尝试调试一个预安装的示例项目。调试会话正在运行,断点起作用,变量值更新,但是无论我在Debugger Console窗口中输入什么,它始终显示“Can only evaluate during a debug session”。有什么办法可以解决这个问题吗?
更新:编译输出如下。
21:51:30: Running steps for project svgviewer...
21:51:30: Configuration unchanged, skipping qmake step.
21:51:30: Starting: "C:\Qt\Qt5.7.1\Tools\QtCreator\bin\jom.exe"
C:\Qt\Qt5.7.1\Tools\QtCreator\bin\jom.exe -f Makefile.Debug
cl -c -nologo -Zc:wchar_t -FS -Zi -MDd -GR -W3 -w34100 -w34189 -w44996 -EHsc /Fddebug\svgviewer.vc.pdb -DUNICODE -DWIN32 -DWIN64 -DQT_QML_DEBUG -DQT_SVG_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I..\svgviewer -I. -I..\..\..\..\5.7\msvc2013_64\include -I..\..\..\..\5.7\msvc2013_64\include\QtSvg -I..\..\..\..\5.7\msvc2013_64\include\QtOpenGL -I..\..\..\..\5.7\msvc2013_64\include\QtWidgets -I..\..\..\..\5.7\msvc2013_64\include\QtGui -I..\..\..\..\5.7\msvc2013_64\include\QtANGLE -I..\..\..\..\5.7\msvc2013_64\include\QtCore -Idebug -I..\..\..\..\5.7\msvc2013_64\mkspecs\win32-msvc2013 -Fodebug\ @C:\Users\msl\AppData\Local\Temp\main.obj.7392.31.jom
main.cpp
C:\Qt\Qt5.7.1\5.7\msvc2013_64\bin\rcc.exe -name svgviewer ..\svgviewer\svgviewer.qrc -o debug\qrc_svgviewer.cpp
C:\Qt\Qt5.7.1\5.7\msvc2013_64\bin\moc.exe -DUNICODE -DWIN32 -DWIN64 -DQT_QML_DEBUG -DQT_SVG_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -D_MSC_VER=1800 -D_WIN32 -D_WIN64 -IC:/Qt/Qt5.7.1/5.7/msvc2013_64/mkspecs/win32-msvc2013 -IC:/Qt/Qt5.7.1/Examples/Qt-5.7/svg/svgviewer -IC:/Qt/Qt5.7.1/5.7/msvc2013_64/include -IC:/Qt/Qt5.7.1/5.7/msvc2013_64/include/QtSvg -IC:/Qt/Qt5.7.1/5.7/msvc2013_64/include/QtOpenGL -IC:/Qt/Qt5.7.1/5.7/msvc2013_64/include/QtWidgets -IC:/Qt/Qt5.7.1/5.7/msvc2013_64/include/QtGui -IC:/Qt/Qt5.7.1/5.7/msvc2013_64/include/QtANGLE -IC:/Qt/Qt5.7.1/5.7/msvc2013_64/include/QtCore -I. ..\svgviewer\mainwindow.h -o debug\moc_mainwindow.cpp
C:\Qt\Qt5.7.1\5.7\msvc2013_64\bin\moc.exe -DUNICODE -DWIN32 -DWIN64 -DQT_QML_DEBUG -DQT_SVG_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -D_MSC_VER=1800 -D_WIN32 -D_WIN64 -IC:/Qt/Qt5.7.1/5.7/msvc2013_64/mkspecs/win32-msvc2013 -IC:/Qt/Qt5.7.1/Examples/Qt-5.7/svg/svgviewer -IC:/Qt/Qt5.7.1/5.7/msvc2013_64/include -IC:/Qt/Qt5.7.1/5.7/msvc2013_64/include/QtSvg -IC:/Qt/Qt5.7.1/5.7/msvc2013_64/include/QtOpenGL -IC:/Qt/Qt5.7.1/5.7/msvc2013_64/include/QtWidgets -IC:/Qt/Qt5.7.1/5.7/msvc2013_64/include/QtGui -IC:/Qt/Qt5.7.1/5.7/msvc2013_64/include/QtANGLE -IC:/Qt/Qt5.7.1/5.7/msvc2013_64/include/QtCore -I. ..\svgviewer\exportdialog.h -o debug\moc_exportdialog.cpp
C:\Qt\Qt5.7.1\5.7\msvc2013_64\bin\moc.exe -DUNICODE -DWIN32 -DWIN64 -DQT_QML_DEBUG -DQT_SVG_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -D_MSC_VER=1800 -D_WIN32 -D_WIN64 -IC:/Qt/Qt5.7.1/5.7/msvc2013_64/mkspecs/win32-msvc2013 -IC:/Qt/Qt5.7.1/Examples/Qt-5.7/svg/svgviewer -IC:/Qt/Qt5.7.1/5.7/msvc2013_64/include -IC:/Qt/Qt5.7.1/5.7/msvc2013_64/include/QtSvg -IC:/Qt/Qt5.7.1/5.7/msvc2013_64/include/QtOpenGL -IC:/Qt/Qt5.7.1/5.7/msvc2013_64/include/QtWidgets -IC:/Qt/Qt5.7.1/5.7/msvc2013_64/include/QtGui -IC:/Qt/Qt5.7.1/5.7/msvc2013_64/include/QtANGLE -IC:/Qt/Qt5.7.1/5.7/msvc2013_64/include/QtCore -I. ..\svgviewer\svgview.h -o debug\moc_svgview.cpp
cl -c -nologo -Zc:wchar_t -FS -Zi -MDd -GR -W3 -w34100 -w34189 -w44996 -EHsc /Fddebug\svgviewer.vc.pdb -DUNICODE -DWIN32 -DWIN64 -DQT_QML_DEBUG -DQT_SVG_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I..\svgviewer -I. -I..\..\..\..\5.7\msvc2013_64\include -I..\..\..\..\5.7\msvc2013_64\include\QtSvg -I..\..\..\..\5.7\msvc2013_64\include\QtOpenGL -I..\..\..\..\5.7\msvc2013_64\include\QtWidgets -I..\..\..\..\5.7\msvc2013_64\include\QtGui -I..\..\..\..\5.7\msvc2013_64\include\QtANGLE -I..\..\..\..\5.7\msvc2013_64\include\QtCore -Idebug -I..\..\..\..\5.7\msvc2013_64\mkspecs\win32-msvc2013 -Fodebug\ @C:\Users\msl\AppData\Local\Temp\qrc_svgviewer.obj.7392.218.jom
qrc_svgviewer.cpp
cl -c -nologo -Zc:wchar_t -FS -Zi -MDd -GR -W3 -w34100 -w34189 -w44996 -EHsc /Fddebug\svgviewer.vc.pdb -DUNICODE -DWIN32 -DWIN64 -DQT_QML_DEBUG -DQT_SVG_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I..\svgviewer -I. -I..\..\..\..\5.7\msvc2013_64\include -I..\..\..\..\5.7\msvc2013_64\include\QtSvg -I..\..\..\..\5.7\msvc2013_64\include\QtOpenGL -I..\..\..\..\5.7\msvc2013_64\include\QtWidgets -I..\..\..\..\5.7\msvc2013_64\include\QtGui -I..\..\..\..\5.7\msvc2013_64\include\QtANGLE -I..\..\..\..\5.7\msvc2013_64\include\QtCore -Idebug -I..\..\..\..\5.7\msvc2013_64\mkspecs\win32-msvc2013 -Fodebug\ @C:\Users\msl\AppData\Local\Temp\moc_mainwindow.obj.7392.343.jom
moc_mainwindow.cpp
cl -c -nologo -Zc:wchar_t -FS -Zi -MDd -GR -W3 -w34100 -w34189 -w44996 -EHsc /Fddebug\svgviewer.vc.pdb -DUNICODE -DWIN32 -DWIN64 -DQT_QML_DEBUG -DQT_SVG_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I..\svgviewer -I. -I..\..\..\..\5.7\msvc2013_64\include -I..\..\..\..\5.7\msvc2013_64\include\QtSvg -I..\..\..\..\5.7\msvc2013_64\include\QtOpenGL -I..\..\..\..\5.7\msvc2013_64\include\QtWidgets -I..\..\..\..\5.7\msvc2013_64\include\QtGui -I..\..\..\..\5.7\msvc2013_64\include\QtANGLE -I..\..\..\..\5.7\msvc2013_64\include\QtCore -Idebug -I..\..\..\..\5.7\msvc2013_64\mkspecs\win32-msvc2013 -Fodebug\ @C:\Users\msl\AppData\Local\Temp\moc_exportdialog.obj.7392.406.jom
moc_exportdialog.cpp
cl -c -nologo -Zc:wchar_t -FS -Zi -MDd -GR -W3 -w34100 -w34189 -w44996 -EHsc /Fddebug\svgviewer.vc.pdb -DUNICODE -DWIN32 -DWIN64 -DQT_QML_DEBUG -DQT_SVG_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I..\svgviewer -I. -I..\..\..\..\5.7\msvc2013_64\include -I..\..\..\..\5.7\msvc2013_64\include\QtSvg -I..\..\..\..\5.7\msvc2013_64\include\QtOpenGL -I..\..\..\..\5.7\msvc2013_64\include\QtWidgets -I..\..\..\..\5.7\msvc2013_64\include\QtGui -I..\..\..\..\5.7\msvc2013_64\include\QtANGLE -I..\..\..\..\5.7\msvc2013_64\include\QtCore -Idebug -I..\..\..\..\5.7\msvc2013_64\mkspecs\win32-msvc2013 -Fodebug\ @C:\Users\msl\AppData\Local\Temp\moc_svgview.obj.7392.421.jom
moc_svgview.cpp
cl -c -nologo -Zc:wchar_t -FS -Zi -MDd -GR -W3 -w34100 -w34189 -w44996 -EHsc /Fddebug\svgviewer.vc.pdb -DUNICODE -DWIN32 -DWIN64 -DQT_QML_DEBUG -DQT_SVG_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I..\svgviewer -I. -I..\..\..\..\5.7\msvc2013_64\include -I..\..\..\..\5.7\msvc2013_64\include\QtSvg -I..\..\..\..\5.7\msvc2013_64\include\QtOpenGL -I..\..\..\..\5.7\msvc2013_64\include\QtWidgets -I..\..\..\..\5.7\msvc2013_64\include\QtGui -I..\..\..\..\5.7\msvc2013_64\include\QtANGLE -I..\..\..\..\5.7\msvc2013_64\include\QtCore -Idebug -I..\..\..\..\5.7\msvc2013_64\mkspecs\win32-msvc2013 -Fodebug\ @C:\Users\msl\AppData\Local\Temp\exportdialog.obj.7392.47.jom
exportdialog.cpp
cl -c -nologo -Zc:wchar_t -FS -Zi -MDd -GR -W3 -w34100 -w34189 -w44996 -EHsc /Fddebug\svgviewer.vc.pdb -DUNICODE -DWIN32 -DWIN64 -DQT_QML_DEBUG -DQT_SVG_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I..\svgviewer -I. -I..\..\..\..\5.7\msvc2013_64\include -I..\..\..\..\5.7\msvc2013_64\include\QtSvg -I..\..\..\..\5.7\msvc2013_64\include\QtOpenGL -I..\..\..\..\5.7\msvc2013_64\include\QtWidgets -I..\..\..\..\5.7\msvc2013_64\include\QtGui -I..\..\..\..\5.7\msvc2013_64\include\QtANGLE -I..\..\..\..\5.7\msvc2013_64\include\QtCore -Idebug -I..\..\..\..\5.7\msvc2013_64\mkspecs\win32-msvc2013 -Fodebug\ @C:\Users\msl\AppData\Local\Temp\mainwindow.obj.7392.31.jom
mainwindow.cpp
cl -c -nologo -Zc:wchar_t -FS -Zi -MDd -GR -W3 -w34100 -w34189 -w44996 -EHsc /Fddebug\svgviewer.vc.pdb -DUNICODE -DWIN32 -DWIN64 -DQT_QML_DEBUG -DQT_SVG_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I..\svgviewer -I. -I..\..\..\..\5.7\msvc2013_64\include -I..\..\..\..\5.7\msvc2013_64\include\QtSvg -I..\..\..\..\5.7\msvc2013_64\include\QtOpenGL -I..\..\..\..\5.7\msvc2013_64\include\QtWidgets -I..\..\..\..\5.7\msvc2013_64\include\QtGui -I..\..\..\..\5.7\msvc2013_64\include\QtANGLE -I..\..\..\..\5.7\msvc2013_64\include\QtCore -Idebug -I..\..\..\..\5.7\msvc2013_64\mkspecs\win32-msvc2013 -Fodebug\ @C:\Users\msl\AppData\Local\Temp\svgview.obj.7392.31.jom
svgview.cpp
link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /SUBSYSTEM:CONSOLE "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST:embed /OUT:debug\svgviewer.exe @C:\Users\msl\AppData\Local\Temp\svgviewer.exe.7392.3416.jom
21:51:35: The process "C:\Qt\Qt5.7.1\Tools\QtCreator\bin\jom.exe" exited normally.
21:51:35: Elapsed time: 00:04.