How to Develop C ++ in Linux

Source: Internet
Author: User

Linux is a general term for a kind of Unix computer operating system. The kernel name of the Linux operating system is also "Linux". You need to pay attention to many issues when developing C ++ in linux, such: reduces unnecessary editing actions and reduces the editing time.

In Windows, development tools are presented to end users in the form of integrated development environment IDE. For example, VS2005 integrates the editor, macro assembly ml, C/C ++ compiler cl, resource compiler rc, debugger, document generation tool, and nmake. They are provided to end users in an integrated manner, which is very convenient for beginners.

However, this business model directly leads to poor user customization, which is not conducive to automation, and the ability to integrate third-party tools is weak. For example, you cannot customize some macros to process repeated operations. You cannot experience the pleasure of automating makefile in one step. You cannot remotely log on to the server for development. You cannot use some "adhesive" to use third-party tools. For example, text tools, string tools) can be effectively called. It can be said that good commercial support and silly development are their main advantages.

In linux, C ++ development tools are cut into independent gadgets. Handle different problems. For example, the editor emacs, vim) is used to edit a program. The Debugger gdb is used to debug the program, and the compiler GCC is used to compile and link the program. The performance analysis tools gcov and gprof are used to compile and link the program) for program optimization, the document builder doxygen) is used to generate documents.

At the same time, there are also some system tools and system knowledge that we need to know: Program automation mechanism makefile, system adhesive shell, system search tool grep, locate, find. Other tools, such as ctags and DMPS of OCI, will become a powerful tool in your hands.

This document describes how to use development tools in LINUX. Because of the wide variety of tools, we do not have the ability to introduce them one by one. For linux ide tools such as eclipse and anjuta, although they are also very practical, they are relatively simple to use and are not currently mainstream. Therefore, they will not be highlighted.

At the same time, this article does not intend to write an operation manual for each tool, but only focuses on the problems, operating mechanisms and main features that each tool wants to solve.

The first thing to do for development is to select an appropriate editor. The editor has several elements:

1) Reduce Unnecessary editing actions and reduce the editing time. All editing tasks that can be described without ambiguity can and should be automated.

For example, every C ++ development has a main function. when importing a file, you want to add some pre-processing commands # define to help us solve the trouble of repeatedly referencing the same header file. Mouse operations are always slower than keyboard operations. In this regard, EMACS is doing its best. Therefore, EMACS users often boast that their editing speed is the same as their thinking speed.

2) high scalability. Programmers expect the editor to provide some programming help, such as syntax highlighting, auto-completion, automatic typographical, and syntax check.

Take a look at gedit, vim, emacs, and ultraEdit, and you will find that they provide far less simple functions than windows notepad. For a new language and new syntax, they should be easily supported without stopping in one or more fixed languages.

3) highly customizable users. If you want to work on R & D for a long time, especially in linux/unix, you need to learn an editor with sufficient functions.

There is one sentence: There are three types of programmers in Linux: emacs, vi, and others. EMACS is a GPL editor written by Stallman in lisp. The emacs mentioned here refers to GNU emacs, not Xemacs.

Because of its openness, we can build it into a powerful IDE. After CGYwin is installed, EMACS can also be used in Windows. CGYwin and MINGW are third-party tools for simulating POSIX systems on Windows.

EMACS is not so much an editor as an operating system. We can use it to write programming, write wiki, send and receive emails, and so on. C ++ is developed in two ways: el script (elisp is a dialect of lisp) and third-party extension package. EMACS has a high entry cost.

Because it is a pure keyboard operation, you need to remember a large number of shortcut keys. The powerful function is achieved by adding some extension packages to the user, and the lisp script. Patience and skill are required to correctly configure and modify the configurations.

  1. Differences between standard input implementation methods in C and C ++
  2. How does the C ++ compiler allocate storage space for Const constants?
  3. Basic Conception and method of C ++ Class Library Design
  4. Several Methods for converting C ++ Language
  5. How to better compile C ++ code

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: 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.