I'm trying to find a way to invoke the Visual Studio C++ compiler (MSVC) from within my Git Bash terminal on Windows. The Developer Command Prompt for VS2017 works fine, it's just annoying to switch between windows just to compile my application.
I tried adding cl.exe
to my Path and was unsuccessful. Google keeps pointing me toward using GCC, which I'm not interested in doing. I was also able to find these two questions, both about Cygwin, one about invoking cl.exe and another about importing vcvars32.bat funcationality (They're linked to each other). The issue is that 1) these are for Cygwin, not MINGW64, and 2) point me to vcvars32.bat/VsDevCmd.bat
. That script seems to mainly be for setting up the development environment (It also passes all smoke tests invoked by VsDevCmd.bat
if that matters.).
So my question(s) is/are:
Is this possible?
How do I resolve bash: cl: command not found
and allow calling cl.exe
from Git Bash?