# Configuring Slicer fails - C compiler not found

**URL:** <https://discourse.slicer.org/t/configuring-slicer-fails-c-compiler-not-found/23340>\
**Category:** Development\
**Tags:** build\
**Created:** [May 9, 2022, 10:11am UTC](https://discourse.slicer.org/t/configuring-slicer-fails-c-compiler-not-found/23340 "2022-05-09T10:11:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [May 9, 2022, 10:11am UTC](https://discourse.slicer.org/t/configuring-slicer-fails-c-compiler-not-found/23340/1 "2022-05-09T10:11:14Z")

</div>

I am rebuilding everything due to the change of version to 5, and on one of the machines I use (after building successfully on another) I’m getting this error.

```auto
c:\d\S5R>"c:\Program Files\CMake\bin\cmake.exe" c:\d\Slicer -G "Visual Studio 17 2022" -DQt5_DIR:PATH=c:\Qt\5.15.2\msvc2019_64\lib\cmake\Qt5 -DSlicer_USE_SimpleITK:BOOL=OFF
-- Setting C++ standard
-- Setting C++ standard - C++14
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19044.
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:51 (project):
  No CMAKE_C_COMPILER could be found.
CMake Error at CMakeLists.txt:51 (project):
  No CMAKE_CXX_COMPILER could be found.

```

What I did:

- Install VS 2022 (Community) from scratch
  - Made sure it installs Windows SDK (10.0.19041.0) (searching online, it seemed to be the problem for others)

- Started VS 2022 (I remembered from earlier versions that setup is fully finalized when starting)
- Checked the files MSBuild.exe and cl.exe, they seem to be in the right place (exactly the same as on the machine it built well)
- Did a Repair on VS 2022
- Restarted the machine a few times

Does anyone has an idea what it may be? Thanks a lot!

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [May 9, 2022, 10:14am UTC](https://discourse.slicer.org/t/configuring-slicer-fails-c-compiler-not-found/23340/2 "2022-05-09T10:14:35Z")

</div>

In `CMakeError.log` I see this  
`LINK : fatal error LNK1104: cannot open file 'ucrtd.lib'`  
Could it be that the Windows SDK I have is not compatible with the Windows version?

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [May 9, 2022, 10:21am UTC](https://discourse.slicer.org/t/configuring-slicer-fails-c-compiler-not-found/23340/3 "2022-05-09T10:21:01Z")

</div>

It turns out I manually had to install the latest Windows SDK (downloaded from [here](https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/)) and then configure got past this error.

Sorry for the noise; maybe for someone this topic will solve the same issue.

---

<div class="post-metadata">

**Author:** ![Alex\_Fergosen](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/alex_fergosen/32/18769_2.png) [@Alex\_Fergosen](https://discourse.slicer.org/u/Alex_Fergosen)\
**Post date:** [March 13, 2023, 12:24am UTC](https://discourse.slicer.org/t/configuring-slicer-fails-c-compiler-not-found/23340/4 "2023-03-13T00:24:07Z")

</div>

I just register to say thank you 🙂  
You saved me after 2 days wasting of time
