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-essentialAfter 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-inAdd Source: http://download.eclipse.org/tools/cdt/releases/indigo
Then select the first CDT Main Feature for installation.
(5) add Environment VariablesPreference-> 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: BlocksThen 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 experienceEditing 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.