Review above:
In the previous article, we learned about the GCC compiler in windows. In this chapter, we will look at the introduction of IDE. I am sorry for this because it takes so long to write this article.
GCC for Win32Development Environment(2)
Chapter 2GccCoat --IDEEnvironment
Section 1IDE for GCCOverview
IDE, that is, integrated development environment, that is, integrated development environment. For Windows programmers who are used to using VC, GCC ide may be unfamiliar in windows. Therefore, I want to use this chapter to briefly introduce the IDE used by GCC.
GccOfIDEWhat is it?
IDE, that is, integrated development environment. She manages Project software to facilitate programmer development. For C/C ++, it consists of four parts. Code Editor, compilation connector, debugger, and tool library. While GCC itself contains the compilation connector, debugger and tool library. Therefore, strictly speaking, the main function of gcc ide is a code editor, which is used to write code.
Therefore, we can see from the above that the tool library is not an IDE, but a compiler. If you use different IDE development projects, as long as you use the same compiler, then she can support the same tool library.
WindowsIsGccDesignedIDEWhat are there?
Many GCC ides are not made commercially, so there are deficiencies in many places. Below are several ides that I personally think are good.
Dev-C ++. This IDE is specially designed for GCC. Visual-mingw, an IDE that imitates the vc6.0 interface. Finally, the most popular code: blocks. It is also recently used, so I am not very familiar with it. However, the first impression is that it is especially like the VC. net interface.
In general, each ide has its own characteristics. For beginners, Dev-C ++ is quite good, because all the tool libraries have the installation packages designed for Dev-C ++. Visual-mingw is a good choice for people who convert from VC to GCC, because as far as I know, most people are familiar with and love vc6.0, therefore, imitating visual-mingw of VC is a good choice. For those who plan to use the GCC development project, code: blocks will indeed become your favorite, because her project management is too good. In fact, everyone will find their own IDE.
Of this bookIDE
Which ide does this book use? In fact, this book is not specifically written for which IDE. Therefore, this book is written for GCC itself. Therefore, the IDE in this book. It is actually the most inconspicuous notepad in windows. However, for ease of writing, I usually use Emacs or notepad ++ to write code. Emacs is an excellent editing software in UNIX environment, and notepad ++ is a notepad enhanced edition. It is suitable for developers. This book will include a MAKEFILE file after each example program. Through this file, you will be able to directly understand the environment configuration method, then, add different parameters for your program based on different ides.
Section 2 most specificDev-C ++
Introduction
Dev-C ++, full name: bloodshed Dev-C ++, is a C/C ++ ide developed by bloodshed. Her default compiler is mingw, but she can support any other GCC versions such as cygwin and GCC itself. She was developed using Delphi, so some C/C ++ developers thought her lineage was not pure. But I personally think, as long as it is suitable, why should we care about what development she uses?
Obtain and install
Dev-C ++, available on her official website http://www.bloodshed.net. On the download page of the official website, you will see three installation programs. I will explain it one by one.
Dev-C ++ with mingw/GCC is the installation package containing mingw. After installing this package, you will have a complete IDE development environment, including the compiler.
Dev-C ++ executable only this is only an IDE installer, which does not include any compilers. If you have not installed the GCC compiler, you will not be able to compile the project after installing this package.
Dev-C ++ source code this is the source code package, of course, only the dev-C ++ code, no GCC code.
Normally, the lazy person chooses the dev-C ++ with mingw/GCC package, which is also a package I suggest for beginners. If you have installed a Windows version of GCC after the previous chapter, you can select Dev-C ++ executable only. If you want to study the code of Dev-C ++ and have some knowledge of Delphi, Dev-C ++ source code is your only choice.
The following describes how to install Dev-C ++ executable only. The installation of Dev-C ++ with mingw/GCC is similar to that of her, but it saves the trouble of configuring the compiler later.
Install
First, download Dev-C ++ from the official website. After running the installer, you will see the following prompt.
This is the language used for installation. Here, we can only select English, because there is no Chinese installation interface.
Select I agree on the license page. I feel that everyone is using pirated software and does not care about licenses. However, as a developer, I should pay attention to the license content, after all, your software is intended for use.
This is the installation option interface. You can select the content you want to install and some installation options, such as whether to associate files. If you download Dev-C ++ executable only, you will not be able to use the mingw Compiler System (binaries, headers and libraries) option because this installation file does not contain this.
This interface allows you to select the installation path. You can select the path where you install Dev-C ++. Let me assume that you have installed it under $ (Dev.
This interface is used to check whether you have installed Dev-C ++ for all users on Windows. Here, I select No. If you want to allow every user on the local machine to use Dev-C ++, you can choose yes.
After the installation program is complete, Dev-C ++ is run by default. At the first run, you will see the following interface.
This is the language, interface icon, and window style used by Dev-C ++. Select, the language we use is Chinese, use the new look icon, and use the XP style window.
This is to ask if you want Dev-C ++ to provide the function complementing function. She will read the function header from the source file and then complete the function for you. However, it takes a certain amount of CPU time. If your machine is OK and you need this function, try it.
So far, our Dev-C ++ installation is successful. If you download Dev-C ++ with mingw/GCC, you can ignore the following content. Because all your ide environments have been configured. If not, you need to install the compiler on your own.
Configure the Compiler
As described in chapter 1, install a GCC porting compiler, either mingw or cygwin. Assume that the directory you installed is $ (GCC). Add the following path to the path of the system variable.
$ (GCC)/bin;
In this way, your Dev-C ++ has the compiler. Of course, you can also download the full set of mingw Dev packages from the dev-C ++ website, and then install mingw with the dev-C ++ package management program.
Add a new project type
In normal times, we usually create our own engineering files. However, if you need to set the environment variables on your own every time, it will be too troublesome for the compiler parameters. This section describes how to add a custom project type to the new project option of Dev-C ++. As shown in,
The Dev-C ++ Project template file is saved in the templates directory of the installation directory. The file ends with a template suffix. You can open it in notepad. Next we will build a project together.
Create a text document named myproject. template in the templates directory. The content is as follows:
[TEMPLATE] Ver = 1 Name = myproject Icon = 0 Description = a small test Catagory = home [Unit0] Cname = Main. c C=myprojectc.txt [Unit1] Cname = myproject. h C=myprojecth.txt [Project] Unitcount = 2 Type = 1 Iscpp = 0 Compiler =-dpassword Linker =-O2 Name = My project Projection = 0 |
[TEMPLATE] |
The content after the tag is an introduction to the project. |
Ver |
The variable is the version of the template file, which is 1 by default. |
Name |
Variable is the project name |
Icon |
The variable is the path of the project icon. If not, enter 0. |
Description |
Variable is an introduction to this template. |
Category |
The variable is the project that this project belongs to. Here we create a type named home. |
[Unitx] |
X is any integer starting from 0 and is the file contained in the definition project. |
Cname |
The variable indicates the default file name when the project is saved. (C language) |
C |
The variable is the source file of the cname file. (C language) |
Cppname |
The variable is the same as the cname variable. It is only used in C ++. |
CPP |
The variable is the same as the C variable, which is used in the C ++ language. |
[Project] |
Tag is an overview of the project |
Unitcount |
Variable indicates the number of files in the project, starting from 1. |
Type |
Variables tell the IDE how the project is compiled. 0 is a Windows window program, 1 is a console program, 2 is a static Connection Library, and 3 is a dynamic Connection Library. |
Iscpp |
The variable indicates whether the current project can only use the C ++ language. 0 indicates no, and 1 indicates yes. |
Compiler |
The variable is a compiler parameter. |
Linker |
The variable is a connector parameter. |
Name |
Variable is the project name |
Projecticon |
Variable is the icon file of the main program after the project is compiled. |
The content of myprojectc.txtand myprojecth.txt is provided below.
// Myprojectc.txt # Include <stdio. h> # Include <stdlib. h> # Include "myproject. H" Int main (INT argc, char * argv []) { Printf ("% s/n", S ); Return (0 ); } |
// Myprojecth.txt # Ifdef Password # Define s "Hello World" # Else # Define s "no password" # Endif |
Restart Dev-C ++. Our project exists in your project.
Last content
The Dev-C ++ function is relatively simple. In addition, the interface is also Chinese. Therefore, you must be familiar with this environment.
VOICEOVER:
In general, Dev-C ++ is a good ide. It is suitable for users who are not familiar with GCC. Of course, I am sorry for the delay in launching this article because I am busy with the exam recently. Now, after a long time for the exam, I wrote some articles at the beginning of the holiday and posted them quickly. I hope you can raise one question. If you have any thoughts or comments, you may be confused. Hope you can submit it on http://blog.csdn.net/visioncat. Thank you.
Studio software development group (SDT)
Studio development team
Dipper (Huang yaokui)
Index:
GCC, windows, IDE, Dev-C ++, introduction, installation, configuration