Ubuntu (Linux) uses eclipse to build a C/C ++ compiling environment

Source: Internet
Author: User

Http://www.cppblog.com/kangnixi/archive/2010/02/10/107636.html

In the past two days, I got a dual system for my computer. In addition to the original Windows 7 system, I installed the Linux system and used ubuntu (Click here to go to the corresponding download page ). At first, I installed fedora9 in Linux. For anyone who has never touched the Linux system, the use of fedora is a crash. Even worse, I use the English version. There is no way to download Linux again, just a CD. Installation System. There was a problem when installing the system, but it was a small problem and it was solved at once. If someone found this articleArticleIf you encounter a problem, leave a message and ask, maybe I can help solve it.

Entered the question.
Install eclipse in two ways:
The first is the built-in Ubuntu Program Install eclipse by using the installation function. Go to the Application> ubtuntu Software Center and find eclipse to install it.
The second method is to use the command: Application-> attachment-> Terminal
Then enter (you may need to enter the password in the middle ):
Sudo apt-Get install eclipse
Sudo apt-Get install eclipse-PVDF
Sudo apt-Get install eclipse-jdt
Explanation:
This command is used to install CDT (that is, to compile C/C ++ ). Code Plug-ins). The original address of a blog post found during the problem is: Use eclipse on Ubuntu to compile C/C ++ code.


For those who first came into contact with Linux, they may not know how to use the command or why to use the command. In fact, I am not very clear, but I want to be related to the system, such as installing software on windows,
They are all in the EXE format, and then double-click it. Next, you can proceed. But Linux should be installed by using commands for security considerations or something.
Ubuntu is good, and software installation is relatively convenient. Like I was just starting to play fedora, installing software is just a crash and there will always be less dependent libraries. To install the software by running commands, you must first
Open the terminal (equivalent to DOS, or a command prompt in the Windows attachment), terminal in the application-> attachment-> terminal. Enter the password in the terminal, unlike
In Windows, there will be a display, such. If the terminal does not display any symbols when you enter the password, don't worry. In fact, all you just entered is already on the terminal, but it is not displayed.
Already. Continue and press Enter.
Note:
When using the first method for installation, the following error may occur during the installation of the CDT plug-in.
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 was not found.

I searched for it, saying that it was not installed on eclipse-PVDF or eclipse-jdt. The URL of its description is as follows: https://bugs.launchpad.net
/Ubuntu/+ Source/eclipse // + bug/477944. All in English. Therefore, if you use the first method, it is best to enter the command on the terminal:
Sudo apt-Get install eclipse-PVDF
Sudo apt-Get install eclipse-jdt

Install the CDT plug-in as follows:
1. Start eclipse,

2. Select help-> install new software..., copy the following address under the work with box: http://download.eclipse.org/releases/galileo

3. Select collaboration-> mylyn Bridge: C/C ++ development, install and restart eclipse.

4. Select programming versions> eclipse C/C ++ development from the options 2 and 3 above. The hard disk is not expensive now. Restart eclipse and try tutorial.
Note:
When installing mylyn Bridge: C/C ++ development, if you directly choose to install eclipse C/C ++ development, the following error will occur:

Cannot complete the install because one or more required items cocould 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'
It cocould not be found

Note:Remember to install the necessary C ++ tools. Install a series of development tools such as GCC tool chain and make. The command is as follows:
Sudo apt-Get install build-essential

Otherwise, the following message is displayed: unresolved upload sion: <iostream>

All right, install eclipse in Ubuntu and the CDT plug-in the same fashion. Here is a post I accidentally found (csdn) and there are CDT-Related Optimization settings.
It is said that eclipse's CDT smart editing is quite powerful and fast. The ease of code editing may be the best practice in all c ++ editors!
Its refactoring and function implementation are all very useful. These are not supported by vs (without VC assistant) and C: B.
Post address: Configure eclipse CDT, support VC compiler, deliver score!

Oh, no, I don't know, but I think there should be no big difference between the poster and the reply recipients ~ In this case, you can play with it. In addition, in Linux
Eclipse IDE is good for C/C ++ programming. I used to play eclipse for a while, so I am familiar with this environment.

Well, after writing it, if the person who found this article needs to install this environment, what went wrong. You can leave a message. Maybe you can help solve this problem ~ Everyone is a newbie to discuss ~
At the same time, I also found a good tutorial on compiling C/C ++ in Linux. JUST CLICK: Eclipse CDT to build the first project.

I just optimized eclipse + CDT according to the above csdn post and found that there were some unnecessary ones, and the post was a bit messy. I sorted it out again, as shown below:

I. C/C ++ environment configuration: window-preferences-C/C ++
1. Appearance, select group method definitions in the Outline View
2. Code style: Use new to create a new code style named qpsoft and initialized to BSD/allmain, and then modify some details as expected. I suggest using the default method, which may be the reason why I used to compile Java. You can follow your own wishes.
3, editor-content assist-auto-activation-delay (MS), the original value is 500, changed to 100, intelligent prompt speed will be very fast!
4. indexer, clear files to index up-front content, and modify the cache limits value to be as large as possible to increase the speed!

2. Modify the smart prompt shortcut:
Window-preferences-General-keys, enter the content, find the content assist, and modify it to shift + space in the binding, which requires a lot of convenience.
I think this can be done according to my habits.

3. Other settings
1. Window-preferences-General-Editors-text editors, select Show line numbers, and set print margin column to 110
2. Window-preferences-General-workspace, cancel build automatically, and select Save automatically before build
I don't understand this setting, but I also set it like this. If you understand this article, please leave a message to answer it.

4. Plug-in extension functions
1. Supported Subversion: officially published by eclipse. The home page is at http://www.eclipse.org/subversive /.
during installation, you can use help-> install new software ..., copy address in Work
with box: http://download.eclipse.org/technology/subversive/0.7/update-
site/

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.