
If required, specify the script to initialize the environment.Ĭlick Apply when all the tools are set correctly. The recommended option is bundled GDB, since it is guaranteed to include Python support required for CLion data renderers. Select the Debugger: you can use either bundled GDB, your MinGW GDB, or a custom GDB binary. If required, open the field to select from the list of other available installations:


In the Toolset field, you will see Bundled MinGW, which is the default option. Go to File | Settings | Build, Execution, Deployment | Toolchains.Ĭlick and select MinGW to add a new MinGW toolchain. In the MinGW installation wizard, select the following packages from the Basic Setup list: mingw-developer-tool, mingw32-base, mingw32-gcc-g++, mingw32-msys-base. 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.Although MinGW-w64 provides both 64- and 32-bit options, you can also install MinGW, the 32-bit-only version. 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/" 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.
