Linux with Anjuta to write a Hello world of C + + program is so simple!

Source: Internet
Author: User
Tags automake
(This article originated in Ubuntu Chinese, the original text has a screenshot)
In IRC, common people ask, learn C + +, what tools to use under Linux. There are recommended Vi/vim and Emacs, personally, it is too hard for beginners like us. The impression that the kdeveloper in KDE is very good, almost as VC is the same powerful and convenient. It's been a few years and I don't know how.

It has recently been found that the Anjuta integrated development Environment (IDE) based on GTK is also very good, smaller, faster, and has automatic code completion and hints. Under NetBeans, develop C + +. Well, it's a bit more anjuta than it is, it's eclipse+cdt, and it's not going to be much better, and the two java-based Ides are slow and memory-intensive.

APT Installation Anjuta
The source has 1.x version, this is not said. A new 2.x version will be installed here, with plug-in architecture, integrated glade.
The environment is Ubuntu feisty 7.04, the following installation steps are referred to the official website instructions (first close the new, update Manager, etc.):

1. Add Source: Click on the main menu of "system" "System Management" "software source", after entering the password, in the dialog box that appears "third party software", point left "add ...", paste the following line, and then press "add Source" "Close" "Reload".
Code:
Deb Http://anjuta.org/apt./


2. APT Installation: Click the "Attachment" "terminal" on the main menu and execute the following command:
Code:
$ sudo apt-get install Anjuta


3. Resolve dependencies: To allow Anjuta to automatically configure, compile, we need to install some necessary packages, the "terminal" to execute the following command:
Code:
$ sudo apt-get install Autogen automake build-essential

This avoids the possibility of new projects, compilations, and the following Run-time errors (other possible autoconf, Automake, etc.).
Code:
Unable to exec g++.real:no such file or directory
Make: * * * * [MAIN.O] Error 2
Completed ... unsuccessful


After the installation is completed to reboot X (that is, log out and login again), the Anjuta part of the icon can be completely normal display. Weird =_=| |

Write Hello World's C + + program
1. Open Anjuta: Click "Application" "Programming" "Anjuta IDE" on the main menu.

2. Build Project: Click on menu in Anjuta, "file" "New" "4. Project ". The Application wizard appears, the point "forward", the type of project selected in "C + +" in "Generic C + +" (Figure Anjuta-1.png), then point "forward"; "forward"; In Project Options, select "No" all (Figure Anjuta-2.png), then point "forward", application can be.

3. View Source: Point to the left "project" button, switch to the "Engineering" tab. Point project name "Foobar-cpp", double-click "main.cc" to open it, editor select "Scintilla Editor" (This only has the code complement full function, the figure anjuta-3.png).

4. Compile run: As you can see, the main () function has been written in advance. We press "SHIFT+F11" to compile, and then press "F3" to be able to run. (these two shortcut keys correspond to the menu under the Build menu.) ) (Fig Anjuta-4.png,anjuta-5.png))

Well, Anjuta's more versatile waiting for you to discover. Click on "Settings" "Plugins" ...

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.