A little experience in the programming of my beginner Linux is shared with you. Published in "Computer Lovers" 2001 No. 5. Looking at my current eyes, this article is really not worth mentioning!
====
With the continuous spread of Linux, more and more people using Linux, there are many programming enthusiasts. But many people have just learned the basic operations of Linux, and they have doubtful to programming this technology: how to design in Linux, what kind of development tools? This article takes a loss of Linux programming and everyone to discuss issues related to Linux programming. As a free operating system, Linux has become the biggest feature of the source, which we can easily get the source code of the Linux system and its application. Linux program is also written in such an environment or The modified work, learned Linux programming, not only can write some shared small programs for everyone, or make a little modification of existing software, allowing them to be more suitable for yourself. There are many tools programmed under Linux. Different versions of Linux also provide different development tools. Commonly used languages are generally C / C , usually Linux provides the C language compiler GCC under the console terminal. As long as we create a C language source program file, such as Hello.c, then run under the terminal: GCC Hello.c, the system will automatically compile the program. If there is no error, generate a.out file in the current directory, otherwise Display an error prompt. After generating a.out, we only need to type ./a.out can run this program. However, the development of such a text command is really inconvenient, so now many versions of Linux provide us with the integrated development environment under the X-Windows graphics interface, such as KDevelop, the blue dot Linux environment, etc., these integrations The environment not only provides us with a good programming interface, but also provides great benefits for programming work. When you run KDevelop for the first time, the system will automatically run the KDevelop setup installer. This program will verify that the files necessary to run KDevelop are complete. After setting, we can start using it. KDevelop shows our integrated development environment similar to Visual C under Linux (see Figure 1). There are several labels such as CV, LFV, RFV, and a list of class lists, logical file lists, and actual file lists, which are mainly included in the left half of this environment. The right half of the development environment is the document display area, which is used to display the source or help information. Below we will use this development tool to develop two applets and try the feeling of Linux programming. Let's try to use it to make a simple and most classic "Hello World!" Program, which is running in the terminal of Linux, like the first program developed when you beginch C language - in DOS Like the "Hello World!" Running. First open the "Project" menu, select "New ...", select "Terminal Program-C Program" in the pop-up Application Wizard (if you are familiar with the use of C programs, you can choose C programs here, but the later program list is I have to modify it) and click Next. " Enter information such as the name of the project in the second page of the wizard, then remove the "generation source file and header file" (see Figure 3). If this is not doing this, Application Wizard will automatically generate some source code, and it is also the "Hello World" program we have to do, but we don't look at this for explaining the problem, we do it yourself.
Click the "Generate" button, wait a little, after the screen appears Ready, click the "Exit" button, our project is generated. Next, we have to enter the source program. Select the "New" command in the file menu, create a new "C / C program" (our example is a C program), the system automatically generates an empty file according to the file header template selected in Application Wizard, we will put the following The program enters this file. When entering, pay attention to the case, the C language is sensitive to the case: #include