Introduction to Linux programming environment

Source: Internet
Author: User
Introduction to the Linux programming environment-general Linux technology-Linux programming and kernel information. The following is a detailed description. Introduction to Linux programming environment

I. Preface

When it comes to programming, you will surely think of many, such as Visual C ++, Visual Basic, Delphi, PowerBuild, java, perl, asp, and so on. Now programmers are used to visual programming tools and step by step programming under the guidance of "Wizard. In a WORD-like environment, you can easily enter the source code. Someone will proofread the code for you and remind you whether the code is correct. After the code is completed, click "compile" in the menu ", the executable program can be generated. Even, you can draw a user interface and use some "wizards" programs to generate a basic program framework, and then modify the program as needed.

I think this is what programmers enjoy in Windows. While the Linux World is another world, everything seems so primitive, simple, original. It will surely bring back memories of the past of programmers who have come out of the DOS world or earlier world. Programmers from the UNIX world will feel very cordial.

On the operating system stage, the two most active factions are Windows and UNIX. Windows is a famous masterpiece of Microsoft's civilization. It completes human-computer interaction with excellent graphic interfaces. It has long swept the world with the desire of Bill Gates to "bring computers into everyone's desktop, become the preferred choice for personal/desktop operating systems. UNIX is an operating system with a long history. It is well known for its robustness, reliability, and profound human-computer interaction language. It is still the first choice for server operating systems.

Therefore, the gift Windows brings to programmers is visual programming! Everything is like using WORD! UNIX appeared before programmers in an uncertain fashion.

Hacker, this name should be familiar to you! In fact, hackers are good or bad, and good hackers are high people who are strongly interested in computer systems. They are happy to discover system vulnerabilities, A group of high-performing people who are interested in studying the system; the bad ones are hackers who are happy to destroy the computer system. These people have extremely low moral qualities and are shameful, is a failure among programmers.

The Windows side is presented to programmers with the most friendly interface, but it strictly limits programmers to thoroughly study it and pack themselves with gorgeous appearances. While UNIX has always been revealing its true nature, mysterious and confusing, and its heart is open to hard-working people. Most hackers are hard-working in UNIX systems.

When you decide to let me go into the linux programming world, you must remember that from now on, you have begun archaeology, and have the courage to challenge yourself, not afraid of trouble, boring.

Ii. Programming Environment in Linux

In the programming of Linux systems, some important features should be paid special attention:

1. Linux is multi-task. You can create multiple processes or threads at the same time. You must never think that your program is the only instance in the system. Other instances of the program can be run by the same user or different users. Therefore, you must be careful with synchronization in some cases.

2. Linux is a real multi-user system. This means that there is a security mechanism to ensure that files of different users are separated. A user's program cannot modify or move any file as in other operating systems unless it is root.

3. Linux has a time-sharing mechanism. Time-sharing means that multiple users can log on at the same time or one user can log on multiple times. Users can remotely log on using telnet or X technology. Because you must know that your program may be used by many users at the same time.

Linux provides many programming tools, including:

1. editing tool: programming in Linux, you no longer have an integrated environment, you can use a tool similar to EDIT-classic vi to EDIT the source program. Of course, there are more advanced ones, such as joe and emacs. In short, the editing program and compilation work are separated.

2. Compilation tools: a large number of languages are supported in Linux, including C, C ++, Java, Pascal, Fortran, and COBOL. C/C ++ is the main language in this lecture. When using these compilation tools, you use the command line method. That is to say, you must first input the source program using the editing tool, and then execute a long string of commands (complicated parameters) for compilation. For example: gcc? O hello. c is to compile hello. c as hello, and then you need to grant it executable permissions so that you can complete the work.

3. software tools: a large software is always composed of multiple source programs. in order to complete a large number of compilation commands, Linux provides the make autoconf tools, it is used for compilation of large software and configuration based on the current state of the machine before compilation.

4. Development Kit: provides excellent gnu c library functions, Motif function libraries, GTK function libraries, and QT function libraries in Linux to provide a lot of support for your programming.

5. project management tools: in Linux, there are excellent software configuration management tools such as CVS for version control and management.

Moreover, Linux, as a free software, provides a large number of Free Software. These free software not only supports executable files, but also supports source programs. You can improve your programming skills by studying these excellent source codes.

3. Programming in Linux

1. Shell programming: Shell is the outermost layer of the Linux operating system. It interacts directly with users and is responsible for interpreting commands. It is like the COMMAND. COM program in DOS. Shell programming is similar to writing a. BAT file. However, it provides a complete set of mechanisms to enable it to have powerful functions. Therefore, you can use Shell programming to better use and manage Linux operating systems.

2. WEB programming: in Linux, it has the best and most popular WEB server Apache, and an excellent PHP script language, therefore, WEB programming in Linux is also very "Qian tu. It includes PHP, JSP, and Perl development.

3. Common Program Development: in Linux, you can use C/C ++ to develop efficient and highly portable applications.

4. User interaction program: in Linux, you can use the ncursor library to Implement User Interaction programs on the Character interface.

5. X-Win programming: in Linux, there is a graphic interface system X-Window that has been inherited from the UNIX system. You can create another place here. In this development, the MOTIF function library, QT function library, and KDE function library can help you.

4. Get help

1. manual page

In Linux and UNIX systems, reference information is stored on the Manpage. The manual page is the main source of reference information. Each Shell command, system call, library function, configuration file, and system daemon are described on a page. The manual page consists of eight parts:

Part 1: Shell commands and user-level programs;

Part 1: System Call related documents;

Part 1: C and C ++ library functions and macro call documents;

Part 1: documents related to special files and devices in the kernel module,/dev directory,/proc, and other directories;

Part 1: different file formats of the system;

Part 1: Game-related documents for historical reasons;

Part 1: documents related to languages or small languages;

Part 1: documents related to the daemon or other system administrator commands.

You can use the man command for search.

2. INFO page: You can view it in the Xemacs browser.

V. Statement completion

Programming in Linux is exciting. You can write high-quality server programs and Applications in Linux. We can also feel how comfortable the kernel is. Let's go all the way to the Linux programming world!
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.