Skip to main content
KMill
Senior
July 2, 2026
Question

Visual Studio Code - adding c/h files to project

  • July 2, 2026
  • 1 reply
  • 50 views

Using the new VSC Integrations, when I add a new .h/.c file to and STM32 project, do I really have to manually update the CMakeLists.txt file too? This seems like a retrograde step.

 

If I just right-click on the SRC or INC folder and add a new file, I get lots of include errors etc, because (I think) CMake is not aware of these files.

AI Told me to try out two extensions, but it was either hallucinating, or they are not available for VSC on macOS.

They were CMake File Helper and/or C/C++ File Creator.

What is the best/suggested way of adding new files to a project?

1 reply

Nawres GHARBI
ST Technical Moderator
July 2, 2026

Hi ​@KMill 
 

 

KMill
KMillAuthor
Senior
July 2, 2026

Thanks, yes I did read that.

Like I said, that seems like a retrograde step. Now I have to manually update the CMakeLists.txt file everytime I add a new source file!

 

 

 

Andrew Neil
Super User
July 2, 2026

Like I said, that seems like a retrograde step. 

Absolutely agree !

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.