# Build Error in Custom 3D Slicer App: 'qMRMLWidget': is not a class or namespace name and pixmapFromIcon not found

**URL:** <https://discourse.slicer.org/t/build-error-in-custom-3d-slicer-app-qmrmlwidget-is-not-a-class-or-namespace-name-and-pixmapfromicon-not-found/42902>\
**Category:** Support\
**Created:** [May 13, 2025, 7:04am UTC](https://discourse.slicer.org/t/build-error-in-custom-3d-slicer-app-qmrmlwidget-is-not-a-class-or-namespace-name-and-pixmapfromicon-not-found/42902 "2025-05-13T07:04:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![software](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/software/32/79627_2.png) [@software](https://discourse.slicer.org/u/software)\
**Post date:** [May 13, 2025, 7:04am UTC](https://discourse.slicer.org/t/build-error-in-custom-3d-slicer-app-qmrmlwidget-is-not-a-class-or-namespace-name-and-pixmapfromicon-not-found/42902/1 "2025-05-13T07:04:48Z")

</div>

Hi all,  
I’m encountering an issue while building a custom 3D Slicer-based application using the Kitware custom app template. I’ve previously created another custom app (around 2 months ago) with the **same versions** of CMake and Qt, and that build completed successfully.

Now, after a long 5.5-hour build process, the current app fails with the following errors:  
\***‘qMRMLWidget’: is not a class or namespace name [E:\New\build\Slicer-build\Applications\NewSlicerApp\qNewSlicerApp.vcxproj]  
‘pixmapFromIcon’: identifier not found [E:\New\build\Slicer-build\Applications\NewSlicerApp\qNewSlicerApp.vcxproj]**  
**The final message is** :  
**Custom build for ‘…Slicer-configure.rule; … Slicer-build.rule; … Slicer-install.rule’ exited with code 1.**  
**What I’ve tried:**

- I double-checked that the Qt and CMake versions match my previous working setup.
- I haven’t made any changes to Slicer core or its dependencies.
- The custom app is based on the same Kitware template I used before.

Any idea why this might be happening now, especially with `qMRMLWidget` not being recognized? Could something have changed in the Slicer nightly/master branch, or do I need to add additional includes or dependencies in the new app?

Appreciate any suggestions or guidance to fix this and complete the build.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [May 13, 2025, 7:34am UTC](https://discourse.slicer.org/t/build-error-in-custom-3d-slicer-app-qmrmlwidget-is-not-a-class-or-namespace-name-and-pixmapfromicon-not-found/42902/2 "2025-05-13T07:34:00Z")

</div>

What commit of Slicer does your custom app specify to build? Is your repo publicly available to see?

Are you using Visual Studio 2022? What version of CMake are you using? What version of Qt?

---

<div class="post-metadata">

**Author:** ![software](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/software/32/79627_2.png) [@software](https://discourse.slicer.org/u/software)\
**Post date:** [May 13, 2025, 7:42am UTC](https://discourse.slicer.org/t/build-error-in-custom-3d-slicer-app-qmrmlwidget-is-not-a-class-or-namespace-name-and-pixmapfromicon-not-found/42902/3 "2025-05-13T07:42:19Z")

</div>

cmake version 3.31.5  
Visual Studio 2022 already installed  
[1/12] project\_name (SlicerCustomAppTemplate): New  
[2/12] github\_organization (Kitware): NewOrg  
[3/12] github\_project (New): NewSlicer  
[4/12] org\_domain ([kitware.com](http://kitware.com)): [neworg.com](http://neworg.com)  
[5/12] org\_name (Kitware, Inc.): New Organization  
[6/12] app\_name (New): NewSlicer  
[7/12] bundle\_identifier (com.neworg.new): com.neworg.newslicerapp  
[8/12] app\_version\_major (0): 0  
[9/12] app\_version\_minor (1): 1  
[10/12] app\_version\_patch (0): 0  
[11/12] app\_description\_summary (Customized version of Slicer): Customized medical imaging platform for New Organization  
[12/12] cdash\_drop\_site ([open.cdash.org](http://open.cdash.org)): [open.cdash.org](http://open.cdash.org)  
\*\*and this is the cmake.txt created \*\*

# Slicer sources

include(FetchContent)  
if(NOT DEFINED slicersources\_SOURCE\_DIR)

# Download Slicer sources and set variables slicersources\_SOURCE\_DIR and slicersources\_BINARY\_DIR

FetchContent\_Populate(slicersources  
GIT\_REPOSITORY ${EP\_GIT\_PROTOCOL}://github.com/Slicer/Slicer  
GIT\_TAG 763a244c8518599b5c4d41123011c4a05cbb0557  
GIT\_PROGRESS 1  
)

---

<div class="post-metadata">

**Author:** ![nyk3151](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/nyk3151/32/80196_2.png) [@nyk3151](https://discourse.slicer.org/u/nyk3151)\
**Post date:** [May 14, 2025, 10:44pm UTC](https://discourse.slicer.org/t/build-error-in-custom-3d-slicer-app-qmrmlwidget-is-not-a-class-or-namespace-name-and-pixmapfromicon-not-found/42902/4 "2025-05-14T22:44:26Z")

</div>

Hello,software.

Actually, I faced same error when trying to build slicer custom app like you.  
I hypothesize that latest version of slicer is still unstable.

Therefore, I changed GIT\_TAG in CMakeLists as follows .

Before

```auto
FetchContent_Populate(slicersources
  GIT_REPOSITORY ${EP_GIT_PROTOCOL}://github.com/Slicer/Slicer
  GIT_TAG 763a244c8518599b5c4d41123011c4a05cbb0557
  GIT_PROGRESS 1
  )

```

After

```auto
FetchContent_Populate(slicersources
  GIT_REPOSITORY ${EP_GIT_PROTOCOL}://github.com/Slicer/Slicer
  GIT_TAG v5.8.1
  GIT_PROGRESS 1
  )

```

This modification made the build successful.
