Build and configure the C/C ++ programming environment eclipse + CDT + mingw

Source: Internet
Author: User

Think about writing it by yourselfProgramTwo years later, vc6.0 was used at the beginning. Later, vs2008 was used, which was good and too big. It was troublesome to install, emacs is used to write makefile by yourself. It is very primitive and very fond of the shortcut keys of Emacs, especially the cursor control. As a result, writing something is always Ctrl + N, CTRL + P, this method started in Taiyuan. Later, I accidentally found that eclipse has three sets of shortcuts, default, VS, and Emacs, so I will decide on you later. This set of things was just a mess at the beginning. it was okay for me to use it anyway. Later, I looked at the online tutorials and saw the door at a Glance. Haha.

This is all nonsense.

1. Install JRE

JRE is still required. Eclipse is written with SWT in Java.

2. Eclipse, CDT

Download the C ++ version of eclipse directly. If you have developed eclipse for Java, download the CDT separately and decompress it to the eclipse directory.

3. Compiler: mingw, Debugger: GDB

Google has all of them, but the GCC that is automatically downloaded has a relatively old version, which may cause problems when processing some UTF-8 encoded files. It can be DIY. I went to the directory of the website to find a newer GCC and download all required files. However, it was quite troublesome. I was able to use it for a long time. Remember to put GDB down, or you won't be able to degug it. In the bindirectory of the compiler, there is a file named "mingw32-make.exe" and the name is changed to make.exe. If you don't want to do it yourself, contact me and I have a ready-made one.

4. Environment Variables

Path: add the bin directory of the compiler to ensure normal compilation.

C_include_path is set to the include directory of the compiler.

LIBRARY_PATH is set to the lib directory of the compiler.

The following two variables ensure that eclipse can find the compiler. They are not necessary. Put the compiler and eclipse in the same directory, and eclipse can find them by itself.

 

OK. Create a C ++ project.

 

Configuration: various configurations are available in WINDOW> preferences.

List several basic items:

Save automatically before compilation. Select save automatically before build in general> workspace.

EnableCodeHide, C/C ++-> Editor-> folding check enable folding when opening a new editor

Shortcut Key settings, General-> keys find a function and set it by yourself

The C ++ include file is in the. Metadata folder corresponding to the workspace, and {workspace} \. Metadata \. plugins \ org. Eclipse. CDT. Make. Core \ {projectname}

Let's explore other things by yourself. By the way, we should not talk about any other Chinese language packs. There are so many English things in Computer Science. Every one of them will go to translation, which is annoying.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.