Skip to content

mambo4/c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Launch VSCode for C/C++ development

TLDR

  1. EDIT launch.bat to correctly point to your
    • project root
    • Microsoft Developers Command Prompt
  2. RUN launch.bat (double click, or run in cmds) to correctly launch this project via the MS Dev cmd prompt

WHY

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.

IF YOU DO NOT HAVE VISUAL STUDIO INSTALLED

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"

WHICH MS DEV PROMPT TO USE

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published