# compiler slicer error

**URL:** <https://discourse.slicer.org/t/compiler-slicer-error/29574>\
**Category:** Development\
**Created:** [May 22, 2023, 12:59pm UTC](https://discourse.slicer.org/t/compiler-slicer-error/29574 "2023-05-22T12:59:37Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ma1282029525](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ma1282029525/32/66047_2.png) [@ma1282029525](https://discourse.slicer.org/u/ma1282029525)\
**Post date:** [May 22, 2023, 12:59pm UTC](https://discourse.slicer.org/t/compiler-slicer-error/29574/1 "2023-05-22T12:59:37Z")

</div>

```auto
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

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [May 22, 2023, 1:11pm UTC](https://discourse.slicer.org/t/compiler-slicer-error/29574/2 "2023-05-22T13:11:51Z")

</div>

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, … ?

---

<div class="post-metadata">

**Author:** ![ma1282029525](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ma1282029525/32/66047_2.png) [@ma1282029525](https://discourse.slicer.org/u/ma1282029525)\
**Post date:** [May 22, 2023, 2:01pm UTC](https://discourse.slicer.org/t/compiler-slicer-error/29574/3 "2023-05-22T14:01:07Z")

</div>

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）](https://github.com/Slicer/Slicer%EF%BC%89) qt version is 5.15.2

---

<div class="post-metadata">

**Author:** ![ma1282029525](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ma1282029525/32/66047_2.png) [@ma1282029525](https://discourse.slicer.org/u/ma1282029525)\
**Post date:** [May 22, 2023, 2:58pm UTC](https://discourse.slicer.org/t/compiler-slicer-error/29574/4 "2023-05-22T14:58:01Z")

</div>

compiler is visual studio 2022

---

<div class="post-metadata">

**Author:** ![ma1282029525](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ma1282029525/32/66047_2.png) [@ma1282029525](https://discourse.slicer.org/u/ma1282029525)\
**Post date:** [May 23, 2023, 11:09am UTC](https://discourse.slicer.org/t/compiler-slicer-error/29574/5 "2023-05-23T11:09:01Z")

</div>

What more information do you need. cmake version is 3.23.3

---

<div class="post-metadata">

**Author:** ![ma1282029525](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ma1282029525/32/66047_2.png) [@ma1282029525](https://discourse.slicer.org/u/ma1282029525)\
**Post date:** [May 23, 2023, 2:07pm UTC](https://discourse.slicer.org/t/compiler-slicer-error/29574/6 "2023-05-23T14:07:24Z")

</div>

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;\*/

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [May 23, 2023, 10:17pm UTC](https://discourse.slicer.org/t/compiler-slicer-error/29574/7 "2023-05-23T22:17:09Z")

</div>

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.
