When using a custom MinGW installation, if CLion cannot detect compilers or make, double-check the installed packages in MinGW Installation Manager. 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.
This directory must not contain any spaces in order to pacify old posix tools and most Makefiles.Although MinGW-w64 provides both 64- and 32-bit options, you can also install MinGW, the 32-bit-only version.
In msys2, you can install a mingw-w64 based compilers for either 32-bit DW2 support or 64-bit SEH support. The standard library support varies drastically between these various compiler flavors (even within the same version). The TDM compilers come in 3 flavors: a 32-bit only version with SJLJ support, a 32-bit only version with DW2 support and a "multilib" compiler which supports only SJLJ in 32-bit mode but can produce 64-bit SEH code. The default compilers that come with mingw_get are 32-bit only compilers and support DW2. Of course, to further complicate matters, different versions of different compilers support different exception handling.
In a 64-bit world, you may still use SJLJ but compilers all commonly support SEH (structured exception handling).
As an example, if you are building code for Rust, you will probably need a modern gcc from msys2 with DW2 support as that's what the panic/exception formatter in Rust depends on.
Certain languages and runtimes have specific requirements as to the exception format supported. DW2 involves more extensive metadata but produces code that cannot unwind MSVC generated stack-frames - hence you need to ensure that you don't have any code that throws across a "system call". SJLJ produces code that can happily throw exceptions across stack frames of code compiled by MSVC. In the 32-bit world, you have SJLJ (set-jump/long-jump) based exception handling and DWARF-2 (shortened to DW2) based exception handling.
C/C++ compilers on windows use various different exception formats and you need to pick the right one for your task. Use the mingw_tdm_gcc resource to fetch a version of the TDM GCC compiler.īy default, you should prefer the msys2 packages as they are newer and better supported.
Use the mingw_get resource in any recipe to fetch mingw packages. Use the msys2_package resource in any recipe to fetch msys2 based packages. # your recipe.rb include_recipe 'mingw::default'