expense or outlayCLionWrite and run c-language programs
Some time ago, I want to try to use CLion to write C language, because I'm used to this style of compiler from Jetbrains, and then there are many problems with the installation and configuration process, which wastes a lot of things, just for your reference.
I. Download CLion
CLion, a cross-platform IDE from Jetbrains, is a professional and powerful C/C++ IDE for beginners to develop C/C++.auto-completeThe multi-line editing feature, smart completion, and the ability to constantly monitor code for potential errors can greatly improve productivity. Insert image description here: Auto-completion and Auto-discrepancy
compareVisual C++ 6.0 or Turbo C++ is a bit more powerful and has better graphics. 😂😂😂
The process of downloading cLion is simple.
Just go to Jetbrain's official website and download it!
Student users can register for free access to the same intelligent idea
As for the Chinese version, I don't think it's necessary to use it, there are just so many words to use for a period of time, and I feel that the Chinese version will cause some unnecessary bugs. if you need it, you can send me a private message.
Then download and install it ok, installation tutorials online is also very detailed, there are problems only need to help Baidu on the line. After the installation can not open, and then we enter the second step.
II. Environment Configuration
CLion doesn't come with a c language environment, so you can't run the program without configuring it. We need to download and configure it ourselves.
These two are generally recommended, I personally recommend MinGW for a simpler installation process.
MinGW download: there are many tutorials online, but it's really a pain in the ass.The official website is here, really slow very slow, Baidu cloud above words can also look for will save a lot of things
But often there is a lack of a certain file these problems, reinstallation can not change, really will drive people crazy. The most common is the prompt lack of libgcc_s_dw2 (⓿_⓿)
I'm going to suggest here what I think is an easier way, download a Dev C++, it's easy to find, various software centers should have it, and then we can just use the Dev C++ environment.
Once Dev C++ has been installed, we need to find aMinGW64The folder will be used later when configuring cLion.
Above are completed, we began to configure the environment, open cLion, and Jetbrains other software similar to the company, teachers and students can apply for free use (URL has been posted above) enter their own account on the OK, or you can also look for related crack tutorials on the Internet, but also a lot of very detailed, just follow it.
After opening cLion select File>>Settings
After that select Toolchains. you will see MinGW in blue, if it is not there, you can add it by clicking on the plus sign in the upper left corner of the edit box. Then we start importing.
As you can see, you need to find in the Environment theMinGW64 as mentioned above. Then click on the yellow box in the picture below. After success, the C complier, and C++ compiler will automatically show up as below, if it doesn't show up, it means you may have missing files. Then the following Debugger will be displayed automatically if you haven't configured it before.MinGW-w64 GDB, if you have configured cygw64, just drop down the menu to change it over, click OK and we have configured it successfully.
Then we can write a Hello cLion to try it out first, since there's still a small problem that hasn't been solved.
Select the following to create a C file .c
Click on the green triangle, or the shortcut shift+F10 to run it. As in the picture above.
O yes, cLion's color font size and so on you can slowly fumble to make changes, or Baidu will give you a good solution.
Then there is the last little problem, if you want to print some Chinese, you will find that he can't print the Chinese characters you expect, but some messy codes.
So how do we fix it?
File -> Settings -> Default Settings -> Editor -> File Encodings:
If your cLion does not have this path, search for it in the search box above cLion
File Encodings file encoding format, change all the formats in it to UTF-8. (It's in the drop-down menu), and click OK to proceed to the final step.
In your cLion, click on UTF-8 in the bottom right corner and change it to GBK as shown above. and you're done. As for the reason, someone on CSDN gave a detailed explanation.
Here's the quote.
/Cbk_XLL/article/details/78752534
Then you can happily use cLion to write C or C++. Take your time to learn its powerful features and don't hesitate to use it!
You can private message me if you have any more questions.