当前位置:网站首页>Install different versions of MinGW (g++/gcc) and the configuration of the corresponding clion editor under Win

Install different versions of MinGW (g++/gcc) and the configuration of the corresponding clion editor under Win

2022-08-11 05:46:00 Ah zink wire rope

1. Download the software package

mingw official website download address
Insert picture description here
1. The first file is the downloader, and some errors may occur.
2. These two correspond to 64-bit operating systems:
: x86_64-posix-sjlj
: x86_64-posix-she
3. These two correspond to 32-bit operating systems:
:x86_64-win32-sjlj
: x86_64-win32-she
4. DWARF: a package with debugging information (DWARF-2 (DW2) EH), so it is larger than the general package size and only supports 32 bitsSystem;
5. Supplementary instructions:
sjlj: cross-platform, supports 32 and 64-bit systems, the disadvantage is: the running speed is slightly slower, GCC does not support
seh: call the system mechanism to handle exceptions, support 32,64-bit system, the disadvantage is: Gcc does not support (will be supported soon)
posix: C++11 multithreading feature enabled

Second, unzip and install

1. Unzip it to the specified directory after downloading.
Copy the unzipped mingw64 directly to the installation directory and customize it.You can also copy the files in mingw64 to a custom named installation directory
Two versions of mingw are installed here:
Insert picture description here
2. Environment configuration
Go to the bin directory and copy the hierarchical path in the figure:
Insert picture description here
Right click on this computer properties:
Insert picture description here
Click on Advanced system settings:

Insert picture description here
Select Path and click Edit:
Insert picture description here
After clicking New on the right, paste the copied bin directory here:

Insert picture description here
The green arrow is the installation location of my bin directory.
This concludes the environment variable configuration.At this point, you can enter gcc -v in the cmd terminal to check whether the installation is successful and the corresponding gcc version:
Insert picture description here
You can restart to make the environment variable configuration take effect before viewing.

Three, clion configuration

1. After clicking file, enter settings:
Insert picture description here
2. As shown in the picture, click "Toolchains" under "Bulid, Execution, Deployment":
Insert image description here
3. Click on the upper right of Download... in the Environment item, and select the MinGW installation directory. As shown in the figure, the blogger's installation path is mingw6481, and you can write it at this level:

4. Select gdb.exe in bin directory for Debugger directory:
Insert picture description here
The rest of the items will be automatically generated, and finally click ok.
5. After the installation is complete, you can check the gcc version in the terminal of clion:
Insert picture hereDescription
Supplementary matters:
(1) To view the gcc version, in addition to the above two methods, you can also view it directly in the bin directory of the installation female donkey:
Insert picture description here
(2) If you need to change the gcc version, install and modify the environment variables and IDE settings in the same way and then restart,Changes to the gcc version of the IDE will take effect.

原网站

版权声明
本文为[Ah zink wire rope]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/223/202208110512453751.html