- EDIT
launch.batto correctly point to your- project root
- Microsoft Developers Command Prompt
- RUN launch.bat (double click, or run in cmds) to correctly launch this project via the MS Dev cmd prompt
C/C++ compiling will not work when VSCode is launched from windows normally. VSCode must launch from the Microsoft Developers Command Prompt to have access to the compiler cl.exe.
The Microsoft Developers Command Prompt is installed with Build Tools for Visual Studio
https://visualstudio.microsoft.com/downloads/?q=build+tools
navigate to Tools For Visual Studio, then Build Tools for Visual Studio 2022, click "download"
The debugger I use is C:\\MinGW\\bin\\gdb.exe, which is a 32 bit debugger
Therefore, This project uses vcvars32.bat.
(I have tested this with vcvars64.bat, and it compiles and runs correctly via cmd, but gdb.execannot debug it. TODO: figure out how to debug a 64 bit compile )
The full path will depend on your version of Build Tools for Visual Studio 2022.
The indiviudal .bat file will depend on the targeted platform (64 bit, 32 bit, amd, etc)
Example MS Dev Prompt paths: (verify on your local workstation)
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars32.bat
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsamd64_x86.bat
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsx86_amd64.bat