Install Code: Blocks and Eclipse CDT in Ubuntu Linux

Source: Internet
Author: User

Recently, I want to try C ++ programming in Linux due to my work and learning needs. So I spent a little time studying C ++ IDE in Linux. Finally, I tried using two famous ides: Code: Blocks and Eclipse. This article will share some of the problems and usage experiences encountered during installation.

1. Install Eclipse CDT in Eclipse (1)

The Installation Method of Tom comes with the following three statements.

     
      
   

In fact, there seems to be a more convenient installation statement.

    (2) install the basic compiling environment build-essential

After installing eclipse, install the basic compilation tool build-essential. The installation method is also simple:

     (3) solve the problem that the global menu is not displayed.

Then we can go to eclipse. After entering eclipse, we will find that the global menu bar is invalid! The menu bar cannot be displayed except the Project column! I checked it online and said it was a bug in Unity on Ubuntu 13.10. Two solutions are provided online:

A. Do not start eclipse directly. Use env UBUNTU_MENUPROXY =/home/user/eclipse to start eclipse. Note that there is A space between the equal sign and the eclipse path.

B. Create an Eclipse shortcut. The content of eclipse. Compile TP is as follows:

          
           
            
             
          

In fact, I think it is easy to combine the two methods. simply use the root permission to modify the existing shortcuts!

           

Then add the following to the last line:

            

In this way, search for eclipse on the Dash page and start it to display the global menu bar.

(4) install the CDT plug-in

Add Source: http://download.eclipse.org/tools/cdt/releases/indigo

Then select the first CDT Main Feature for installation.

(5) add Environment Variables

Preference-> C/C ++-> Build-> Environment

Variable: CPP_INCLUDE_PATH

Value:/usr/include/c ++/4.8.1 (gcc Version)

Variable: C_INCLUDE_PATH

Value:/usr/include

 

Ii. Code: Blocks

Then there is Code: Blocks. If you see a post, we recommend that you use Code: Blocks to give you the convenience of Visual Studio on Windows. Code: the installation of Blocks is very simple, you can operate in the Software Center.

However, when Code: Blocks is used, a problem occurs: it cannot be entered in some cases! Turning to the omnipotent Internet, I finally found the answer: Code: Blocks is incompatible with the ibus input method. Just change it to another input method.

 

Iii. usage experience

Editing C ++ in Eclipse is not as convenient as writing Java. At least the operation is correct.

At the beginning, I created a new C ++ file, and entered using std: cout and using std: endl in it. Then, cout still cannot be correctly identified in the main function. Later, I found that the source file must be saved once, And cout and endl will be correctly identified.

Second, Eclipse can help users complete the code just as it prompts the Java code, but it must be activated using <Ctr> + </>. I don't know if it makes sense? Why isn't it as convenient to prompt like Java?

Code: Blocks provides a good user experience. Simple operation and complete code prompts. When using the object or struct pointer to take the component, the unique beauty deficiency cannot automatically Replace "." with "-> ". C # is often used to writing. At first glance, C ++ is a little uncomfortable.

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.