This is the correct way.
Make sure to build the project once and rebuild the intellisense (Ctrl+Shift+P → Rebuild IntelliSense).
If you are mixing .c with .cpp code, odn’t forget to add the standard extern "C" declarations.
.c
.cpp
extern "C"