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

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!

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?

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): 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): 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
)