# Error on Visual studio platform

**URL:** <https://forums.freertos.org/t/error-on-visual-studio-platform/22999>\
**Category:** Kernel\
**Tags:** tutorial\
**Created:** [April 28, 2025, 4:17pm UTC](https://forums.freertos.org/t/error-on-visual-studio-platform/22999 "2025-04-28T16:17:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Black018872](https://avatars.discourse-cdn.com/v4/letter/b/2bfe46/32.png) [@Black018872](https://forums.freertos.org/u/Black018872)\
**Post date:** [April 28, 2025, 4:17pm UTC](https://forums.freertos.org/t/error-on-visual-studio-platform/22999/1 "2025-04-28T16:17:36Z")

</div>

Hello everyone,

I’m working on a demo project from FreeRTOS on GitHub. I followed the instructions on the website and some YouTube videos. However, when I started building the project, I encountered some errors that I don’t understand. I’ve attached detailed of the errors below. I’m just a newbie, could someone please help me,thanks?

“cannot open source file “stdio.h”  
cannot open source file “FreeRTOS.h”  
cannot open source file “task.h”  
cannot open source file “timers.h”  
cannot open source file “semphr.h”  
unrecognized token  
‘#’ not expected here  
identifier “TimerHandle\_t” is undefined  
identifier “QueueHandle\_t” is undefined  
identifier “NULL” is undefined  
identifier “TimerHandle\_t” is undefined  
identifier “NULL” is undefined  
identifier “TickType\_t” is undefined  
identifier “uint32\_t” is undefined  
identifier “NULL” is undefined  
identifier “configMINIMAL\_STACK\_SIZE” is undefined  
identifier “tskIDLE\_PRIORITY” is undefined  
identifier “pdTRUE” is undefined  
identifier “TickType\_t” is undefined  
identifier “TickType\_t” is undefined  
identifier “uint32\_t” is undefined  
identifier “TimerHandle\_t” is undefined  
identifier “uint32\_t” is undefined  
identifier “uint32\_t” is undefined  
identifier “portMAX\_DELAY” is undefined  
identifier “NULL” is undefined  
identifier “portMAX\_DELAY” is undefined  
The VCToolsInstallDir property is not defined. Some build tools may not be found.  
The WindowsSDKDir property is not defined. Some build tools may not be found.  
Failed to locate: “CL.exe”. The system cannot find the file specified.”

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [April 28, 2025, 6:00pm UTC](https://forums.freertos.org/t/error-on-visual-studio-platform/22999/2 "2025-04-28T18:00:10Z")

</div>

Which project are you trying to build, and how are you trying to build it? For example, is there a cmake file or something else?

---

<div class="post-metadata">

**Author:** ![Black018872](https://avatars.discourse-cdn.com/v4/letter/b/2bfe46/32.png) [@Black018872](https://forums.freertos.org/u/Black018872)\
**Post date:** [April 29, 2025, 4:34am UTC](https://forums.freertos.org/t/error-on-visual-studio-platform/22999/3 "2025-04-29T04:34:50Z")

</div>

I start with Win32-MSVC from the demo directory, then I click Local Windows Debugger, and the errors I mentioned above appear.

some information from output windows :  
"Build started at 9:31 PM…  
1\>------ Build started: Project: RTOSDemo, Configuration: Debug x64 ------  
1\>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(515,5): warning MSB8003: The VCToolsInstallDir property is not defined. Some build tools may not be found.  
1\>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(516,5): warning MSB8003: The WindowsSDKDir property is not defined. Some build tools may not be found.  
1\>TRACKER : error TRK0005: Failed to locate: “CL.exe”. The system cannot find the file specified.  
1\>Done building project “WIN32.vcxproj” – FAILED.  
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========  
========== Build completed at 9:31 PM and took 01.870 seconds ==========  
"

My hypothesis is that the environment setup is incorrect; however, the error seems to indicate that the included file doesn’t exist. I have no clue about this.

---

<div class="post-metadata">

**Author:** ![karahulx](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/karahulx/32/4893_2.png) [@karahulx](https://forums.freertos.org/u/karahulx)\
**Post date:** [April 29, 2025, 4:41am UTC](https://forums.freertos.org/t/error-on-visual-studio-platform/22999/4 "2025-04-29T04:41:53Z")

</div>

You are correct in your hypothesis that your build environment is wrong.  
You need to install or repair Visual Studio 2022 to add C++ development tools:

1. Open Visual Studio Installer.
2. Select **Modify** on your current Visual Studio 2022 installation.
3. Under the Workloads tab, make sure the following are installed:

- Desktop development with C++
- (Optional but good) Windows 10 SDK or Windows 11 SDK.

1. Restart Visual Studio.

Then you can re-run the FreeRTOS Demo and see if it works.

---

<div class="post-metadata">

**Author:** ![DakshitBabbar](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/dakshitbabbar/32/4822_2.png) [@DakshitBabbar](https://forums.freertos.org/u/DakshitBabbar)\
**Post date:** [April 29, 2025, 5:38am UTC](https://forums.freertos.org/t/error-on-visual-studio-platform/22999/5 "2025-04-29T05:38:28Z")

</div>

Hey @Black018872,  
Welcome to the community. The errors you got could also occur because of the following issue:

While cloning the FreeRTOS repository you did not clone the submodules. This happens when we do not clone the repository with the `--recurse-submodules` flag. If this was the case, you can now simply run the following command from the root of the repository:

`git submodule update --init --recursive`

This would fetch and clone all the code for the submodules present in the repository and the demo code should build successfully.
