On Windows, CLion toolchains include the build tool, C and C++ compilers, debugger executable, and the environment. You can select one of the pre-defined toolchain setups (MinGW,
Cygwin, Microsoft Visual C++, or WSL),
Remote Host, Docker) or configure a custom toolchain (System): Watch this video for an overview of Windows toolchain options: For
details on Remote Host toolchains, see Full Remote Mode. If you are working with a Docker container, see Docker toolchain. CLion bundles a version of the MinGW
toolset for quick setup. The exact version bundled is MinGW-w64 9.0 with languages=c,c++, posix threads, and seh exceptions. You can use this bundled toolchain or switch to a custom MinGW installation. Download and run the MinGW-w64 installer. It provides both 64- and 32-bit options. In the MinGW-w64 installation wizard, make sure to select the required architecture. Note that the default suggested option is 32-bit. Wait for installation to finish. Although MinGW-w64 provides both 64- and 32-bit options, you can also install MinGW, the 32-bit-only version. 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. Wait for installation to finish. Configure a MinGW toolchain
Cygwin
Windows Subsystem for LinuxYou can use WSL, Windows Subsystem for Linux, as your working environment in CLion on Windows 10 (starting the Fall Creators Update version 1709, build 16299.15). WSL toolchain enables you to build projects using CMake and compilers from Linux and run/debug on WSL without leavCLionLion running on your Windows machine. Microsoft Visual C++
MSVC compilerCLion supports the Microsoft Visual C++ compiler that ships with Visual Studio 2013, 2015, 2017, and 2019. Note that msbuild is not supported: CLion runs CMake with the NMAKE generator instead. For the case when your code includes MSVC extensions, CLion provides the support for:
Clang-cl compilerAs an alternative compiler, you can use clang-cl - the MSVC-compatible compiler driver for Clang. CLion supports clang-cl version 8.0 and later.
Note that currently the -T clangcl options can't be picked up if the bundled CMake is in use along with the Visual Studio toolchain setup (CPP-18848). MSVC debuggerThe MSVC toolchain debugger is implemented on top of LLDB, and it can work with native visualizers from the Visual Studio installation or from your project. To enable native visualizers support and set the desired diagnostics level, select the Enable NatVis renderers for LLDB checkbox in : CLion automatically generates one-line summaries for all structures not covered by Natvis and highlights them to increase readability. Also, the built-in formatters provide visualization for wide/Unicode strings (wchar_t, char16_t, char32_t). If you have custom native visualizers in your project, CLion will use them as well. CLion supports most of the Natvis customization features, such as ArrayItems, IndexListItems, LinkedListItems, TreeItems, Inheritable attribute, Format specifiers, and CustomListItems. When using the MSVC toolchain debugger, you can enable symbol servers support which will help the debugger resolve library symbols correctly. For more details, refer to Using symbol servers when debugging on Windows. System toolchainThe System toolchain on Windows allows configuring the build tool, compilers, and debugger without selecting a predefined toolset or environment, similarly to Linux and macOS. Use this toolchain option for embedded development cases like using ARM or for other custom setups.
Initializing the toolchain environment via a scriptYou can point CLion to the script that initializes the environment for your project without the need to set the variables manually. This is helpful, for example, when you need to initialize compiler variables, add custom ones, or modify the PATH. Specifying an environment script is available for all toolchains. However, it is not supported for CMake presets at the moment (CPP-26576). Environment sourcing will happen on the first actual usage of the toolchain in a CMake profile or upon loading a Makefile project.
Clang compiler on WindowsWith CMake 3.15, it has become possible to use the Clang compiler on Windows with the MinGW-w64/MinGW toolchain. However, the LLVM Clang for Windows is built using Microsoft Visual Studio, and all the built-in macros and include search paths are set up for use with Visual Studio. So if you take Clang from the LLVM repository, it will not work correctly when configured with the MinGW toolchain. One of the possible workarounds is described below. Set up the Clang compiler for MinGW
GDB on WindowsIn the case of MinGW, CLion includes the bundled GDB (version 11.1). For Cygwin, you need to install the GDB package in the Cygwin Package Manager, as described in the Cygwin section of this guide. You can also switch to a custom GDB binary. In this case, the supported GDB versions are 7.8.x-11.1. Note that for GDB 8.0 and later, debugger output is redirected to CLion console by default. To enable opening an external console window for application input/output, go to Help | Find Action or press Ctrl+Shift+A, search for Registry, and set the following key: cidr.debugger.gdb.workaround.windows.forceExternalConsole. Last modified: 27 July 2022 How do I fix g ++ not recognized?You need to set the environment PATH to include the directory of mingw's bin directory if you want o use gcc.exe or g++.exe in cmd . run 'path' or 'echo %PATH% in cmd.exe prompt. Check the path carefully.
How do you solve this error G ++' is not recognized as an internal or external command operable program or batch file?After downloading, install MinGW and wait for the “MinGW Installation Manager” to show up.. When the “MinGW Installation Manager” shows up, click on mingw32-gcc-g++ then select “Mark for Installation”. In the menu at the top left corner, click on “Installation > Apply Changes”. Wait and allow to install completely.. Is not recognized as an internal or external command operable program or batch file?You can resolve this issue in three ways: First, use the full path of the executable file to launch the program. Second, add the program path to Windows environment variables. Finally, move the files to the System32 folder.
|