compiler slicer error

46>  moc_qSlicerApplication.cpp
46>E:\Slicer_all\SlicerBuild\Slicer-build\Base\QTGUI\moc_qSlicerApplication.cpp(280,20): error C2065: “ctkQtTestingUtility”: 未声明的标识符 [E:\Slicer_all\SlicerBuild\Slicer-build\Base\QTGUI\qSlicerBaseQTGUI.vcxproj]
46>E:\Slicer_all\SlicerBuild\Slicer-build\Base\QTGUI\moc_qSlicerApplication.cpp(280,41): error C2065: “_r”: 未声明的标识符 [E:\Slicer_all\SlicerBuild\Slicer-build\Base\QTGUI\qSlicerBaseQTGUI.vcxproj]
46>E:\Slicer_all\SlicerBuild\Slicer-build\Base\QTGUI\moc_qSlicerApplication.cpp(280,50): error C2039: "testingUtility": 不是 "qSlicerApplication" 的成员 [E:\Slicer_all\SlicerBuild\Slicer-build\Base\QTGUI\qSlicerBaseQTGUI.vcxproj]
46>E:\Slicer_all\SlicerBuild\Slicer-build\Base\QTGUI\../../../../slicersouse/Slicer/Base/QTGUI/qSlicerApplication.h(60,34): message : 参见“qSlicerApplication”的声明 [E:\Slicer_all\SlicerBuild\Slicer-build\Base\QTGUI\qSlicerBaseQTGUI.vcxproj]
46>E:\Slicer_all\SlicerBuild\Slicer-build\Base\QTGUI\moc_qSlicerApplication.cpp(281,43): error C2061: 语法错误: 标识符“ctkQtTestingUtility” [E:\Slicer_all\SlicerBuild\Slicer-build\Base\QTGUI\qSlicerBaseQTGUI.vcxproj]

I unchecked the compile test program

To be able to assist you we would need more context about the error.

Scrolling up in the terminal may allows you to find more details.

Additionally, a lot of context is missing: version of Slicer, which compiler, … ?

46>-- Trying to find DCMTK expecting DCMTKConfig.cmake - ok
46>-- Found PythonLibs: E:/Slicer_all/SlicerBuild/python-install/libs/python39.lib (found suitable version “3.9.10”, minimum required is “3.9”)
46>Traceback (most recent call last):
46> File “”, line 1, in
46>AttributeError: module ‘sys’ has no attribute ‘abiflags’
46>-- Configuring Slicer with python 3.9
46>-- Configuring MRML
46>-- MRML_APPLICATION_NAME is Slicer
46>-- MRML_APPLICATION_VERSION is 0x050300
46>-- MRML_APPLICATION_REVISION is 31756
46>-- MRML_APPLICATION_SUPPORT_VERSION is 0x030000
46>-- Configuring library: ITKFactoryRegistration
46>-- ITK is setting ITKFactoryRegistration’s MSVC_RUNTIME_LIBRARY to dynamic
46>-- Configuring library: vtkAddon [vtkAddon_SOURCE_DIR: E:/Slicer_all/SlicerBuild/vtkAddon]
46>-- Found OpenGL: opengl32

slicer version is I don not konw (but yeastrday git colone https://github.com/Slicer/Slicer) qt version is 5.15.2

compiler is visual studio 2022

What more information do you need. cmake version is 3.23.3

Delete line 280 281 of MOC_ qSlicerApplication. CPP to successfully compile, but I want to run it in Slicer and click debug. It will compile again for a long time…, Is there a solution?

/* case 29: { ctkQtTestingUtility* _r = _t->testingUtility();
if (_a[0]) reinterpret_cast< ctkQtTestingUtility*>(_a[0]) = std::move(_r); } break;*/

One build tree can only be used for either debug or release mode. If you have already built Slicer in release mode then you cannot simply switch the build mode, but you need to configure a new build folder from scratch and build in debug mode to begin with.