Ubuntu 12.04 using Eclipse to build a C + + build environment

Source: Internet
Author: User

First, there are two ways to install eclipse:
The first is to install Eclipse through the program installation features of Ubuntu, Application->ubtuntu Software Center, search Eclipse installation.
The second method is to use the command: application---Accessories--terminal
Then enter (you may need to enter a password in the middle):
sudo apt-get install eclipse
sudo apt-get install Eclipse-pde
sudo apt-get install ECLIPSE-JDT
Explain:
This command is in the address of a post that was found when installing the CDT (that is, a plugin that can compile C/
For the first contact with Linux, you might not know how to use commands or why. In fact, I am not particularly clear, but I want to be related to the system, like Windows installation software, are EXE format, and then double-click, the next step is OK, but Linux should be for security reasons or something, need to use the command to install. Ubuntu is good, it is relatively convenient to install the software. Like the fedora I just started, installing the software is a bit of a crash, and it's always less dependent on the library. To install the software using the command, first open the terminal (equivalent to DOS, or the command prompt inside the Windows attachment), terminal in the application---Accessories--. Enter the password in the terminal, not like windows, there will be a display, such as *. If you enter the password, the terminal does not have any symbols display, do not worry, in fact, you have just entered the terminal has been, but did not show it. Continue to lose is, and then press the ENTER key.
Attention:
The following error may occur during installation of the CDT plug-in when using the first method of installation
An error occurred while installing the items
Session context was: (Profile=platformprofile, phase= Org.eclipse.equinox.internal.provisional.p2.engine.phases.Install, Operand=null--[R]org.eclipse.ant.ui 3.4.1.v20090901_r351, Action=org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.installbundleaction).
The artifact file for osgi.bundle,org.eclipse.ant.ui,3.4.1.v20090901_r351 is not found.
I searched, said Eclipse-pde or ECLIPSE-JDT not installed. The URL of its description is as follows: https://bugs.launchpad.net/ubuntu/+source/eclipse/+bug/477944. All in English. So, if you use the first method, the best, and then enter the command in the terminal:
sudo apt-get install Eclipse-pde
sudo apt-get install ECLIPSE-JDT

To install the CDT plugin, the method is as follows:
1. Start Eclipse,
2. Select Help->install New software ..., and copy the following address in the work with box: Http://download.eclipse.org/releases/galileo
3, choose Collaboration->mylyn bridge:c/c++ Development, install, restart Eclipse.
4, with the above 2, 3, choose Programming Languages->eclipse C + + development, are selected, now hard drive is not expensive. Restart Eclipse, try it, have tutorial.
Attention:
In the installation of Mylyn bridge:c/c++ development, if you choose to install Eclipse C + + development directly, the following error occurs:
Cannot complete the install because one or more required items could not be found.
Software being Installed:mylyn bridge:c/c++ development 5.1.0.200909110608 (Org.eclipse.cdt.mylyn.feature.group 5.1.0.200909110608)
Missing Requirement:mylyn bridge:c/c++ Development 5.1.0.200909110608 (Org.eclipse.cdt.mylyn.feature.group 5.1.0.200909110608) requires ' Org.eclipse.mylyn.context.core 3.0.0 ' but it could wasn't be found

Note: To remember to install the necessary tools for C + +, install a series of development tools such as the GCC toolchain, make, and commands as follows:
   
sudo apt-get install build-essential
Otherwise include the header file when the prompt appears: unresolved inclusion: <iostream>

OK, under Ubuntu, install Eclipse, while installing the CDT plug-in, the perfect solution, the following is I accidentally found a post (CSDN), there are related to the CDT optimization settings. It says that Eclipse's CDT Smart Editor is quite powerful and fast-exploding. and its easy-to-use for code editing is probably the best in all of the C + + editors today! Its refactoring, function implementation, are very useful. These are not possible with VS (without VC assistant) and c::b.

Oh, is not, I do not know, but look at its posts, there are replies to people, are strong, I think there should not be very big in and out of it ~ that being the case, use to play. And, it feels like under Linux, programming for C + +, Eclipse's IDE is great. I used to play eclipse for a while, so I'm quite familiar with the environment.

Well, finished, if the person who found this article, need to install the environment, the middle of what is wrong. Can leave a message, perhaps can help solve ha ~ Everyone is a novice, discussion and discussion ~
At the same time, I also found a good Linux write-C + + tutorial, direct click: Eclipse CDT Build the first project

Just follow the above Csdn's post to eclipse+cdt some optimization, found that some are not unnecessary, and the post is a bit messy, I re-organize, as follows:

First, C + + environment configuration: window-preferences-c/c++
1, appearance, select group method definitions in the Outline view
2, code style, through new to create a new code style, named Qpsoft, and initialized to Bsd/allmain, and then modify some of the details by habit. My advice is to use the default, perhaps the reason I used to write Java writing habits. Can come according to their own wishes.
3, Editor-content Assist-auto-activation-delay (MS), the original value is 500, changed to 100, the smart prompt speed will be very fast!
4, Indexer, empty files to index up-front content, modify the value of the cache limits, as large as possible, can improve speed!

Second, modify the smart prompt shortcut key:
Window-preferences-general-keys, input content, find content Assist, in the binding modified to Shift+space, more handy.
I think this can be in accordance with their own habits, hehe.

Third, other settings
1. Window-preferences-general-editors-text Editors, check show line numbers, set print margin column to 110
2. Window-preferences-general-workspace, cancel build automatically, select Save automatically before build
I'm a little confused about this setting, but I've set it up as well. If you understand, see this article, Hope message answer.

Four, through the plug-in extension function
1. Support Subversion:eclipse official production, home page is located in http://www.eclipse.org/subversive/.
At installation you can copy the address by Help->install New software ..., in work with box: http://download.eclipse.org/technology/subversive/0.7/ update-site/

Ubuntu 12.04 using Eclipse to build a C + + build environment

Related Article

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.