I'm assuming that you are coming from the "native" build of Emacs, in which case, you might also find useful the cygwin-mount module for Emacs. My only complaint is that Microsoft changed the output of errors and so automatically jumping to lines in code from compiler output is currently broken (I need to look into fixing that). You can get as complicated as you need (in my current project I've got build and test shell scripts that callout to scons and I tend to eschew batch files, as shell is much more powerful). I then construct a compile command of either scons or -build "Release|Platform MySolution.sln, and things go merrily along from there. PATH=$:"/c/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/" The GNU project’s text editor Emacs is now available in version 27.1, which introduces native JSON parsing and tab bar support, allows basic image transformations without ImageMagick, and uses HarfBuzz, a tool also employed in GNOME, KDE, and Android, to make text look nice. SCons installs from Cygwinports ( ) and ends up in /usr/bin, which is in the standard path, but is buried deep in Visual Studio to get access to it, I add it's containing directory to my PATH (in my ~/.bash_profile): case $OS in This of course requires installation of SCons and Visual Studio, but it is possible.
Ultimately, if you can't run it on command line (either cmd.exe or /bin/bash from Cygwin or MinGW), it won't work in any Emacs.Īs an example, I compile C++ in Emacs using both SCons/g++ from Cygwin and from MS Visual Studio.
If you're using the "native" Emacs for Windows, or mixing Cygwin/MinGW/etc, things get a little more complicated (and other answers have solutions), but it boils down to making sure that your environment variables are setup correctly (eg PATH, SHELL, etc).
If you install Emacs and g++ in Cygwin, it should work just like Linux, which is to say that you can run M-x compile and use g++ myFile.cpp as your compile command.