Dev-CPP/mingw32 Environment Introduction (12)

Source: Internet
Author: User

Dev-CPP/mingw32 Environment Introduction (12)

Review above:
In the previous article, we learned how to set and use GTK in mingw. From this article, we will begin to enter the intermediate article. That is to say, we mainly use mingw and other GCC in Win32. Instead of introducing only those operating IDE and installing components. If we used to be on the runway, we are about to take off now. Therefore, we will pay more attention to program configuration using makefile. Some Dev-CPP settings are also included.

Chapter 2 GCC installation under Win32

Many people may ask, since we have a simple installation tool such as Dev-CPP, why should we learn how to install the GCC compiler such as mingw? Isn't that an alternative? You know, from now on, you have been reading intermediate content, and you do not want to install mingw by installing Dev-CPP. Now that you have selected GCC, you know how to install some variants of GCC under Win32, which should also be known by intermediate students.

Mingw, I don't want to introduce it. This is what comes with Dev-CPP. Cygwin, a software group simulating UNIX interruptions under Win32, is not the first choice for real Win32 development, so I will omit it here. Djgpp is a software program that can develop 16-bit programs under Win32. Of course, it can also run your software under DOS. Through some of the above introduction, I think you must know that the compiler we want to install is mingw and djgpp.

Mingw installation is actually very simple. You can download the latest version from the http://www.MinGW.org. However, it is recommended that you take a closer look, because some of them are still being tested. The file to be downloaded is as follows (C language is installed by default, but C ++ is not included. If necessary, you only need to download the C ++ file ).

Binutils includes program groups required for programming such as LD and.
Gcc-core C language compiler
Mingw32-make-3.80.0-3 make program
Mingw-runtime includes most of the program's header files and library files (excluding WIN32API)
W32api contains the header file and library file of Win32 API.

If you need other services such as Java, C ++, and Ada, you can download them from the above URL. Good luck.

After the download, decompress all the files to a directory, such as the mingw directory. If duplicate names exist, files such as licenses can be tracked or not copied.
These packages are all generated using the GNU compression tool. The file name is not zip. You can use WinRAR. Or use the gnuwin32 tool to decompress the package.
Http://www.gnuwin32.org
Download the tar program.
If the file you downloaded is * .tar.gz, download gzip.
If the file you downloaded is * .tar.bz2, download the bz2 Program (this is not recommended)

Then, use the command
Gunzip (file name .tar.gz)
Tar-xvf (file name .tar)

You can unlock it.

In fact, the installation of these tools is very simple. I personally prefer tools that extract data directly. In this way, no other junk files will be generated.

Djgpp, which may be unfamiliar to you. This is the GCC in DOS. You are not mistaken. This is indeed the GCC in DOS. You can run the djgpp program on the boot disk of the MS-DOS. You can also do this on the boot disk on freedos. This is true. It is difficult to install djgpp.
On the http://www.delorie.com/djgpp/ you can download to the file you want, this is the official website of djgpp.
On the download page, there is a page for selecting the file to be downloaded using the parameters you have given. You can make your choice with your own requirements.
Here, the download is (for a long time, keneng is very old)
Bnu216b.zip
Djdev203.zip
Gcc400b.zip
Gdb611b.zip
Mak1_1b.zip
Txi48b.zip

Decompress all these files to a directory. Then, set the variables for the system.

Djgpp = (djgpp installation path)/djgpp. env

In this case, the installation is complete. Because it is intermediate. Therefore, a lot of things won't be taught step by step as before.

Cygwin, though not introduced above. But here we will introduce it.
You can download setup.exe from cygwin's official website as a network installation version. Many things need to be downloaded from the Internet. You can use it to download it directly from the Internet. You can also download it by yourself. Next, I will introduce my installation methods.
Http://mirrors.kernel.org/sources.redhat.com/cygwin/release/
Obtain the setup. ini configuration file from the above address. To obtain the dependency.
I will extract a section from it to explain it.

@ Gcc
Sdesc: "C compiler upgrade helper"
Category: devel
Requires: cygwin ash binutils w32api mingw-runtime libintl3 gcc-core gcc-G ++ gcc-mingw-core gcc-mingw-G ++
Version: 3.4.4-1
Install: Release/GCC/gcc-3.4.4-1.tar.bz2 46 c616cffee0f344c37fd4e045a7a87054
Source: Release/GCC/gcc-3.4.4-1-src.tar.bz2 46 c616cffee0f344c37fd4e045a7a87054
[Prev]
Version: 3.3.3-3
Install: Release/GCC/gcc-3.3.3-3.tar.bz2 46 c616cffee0f344c37fd4e045a7a87054
Source: Release/GCC/gcc-3.3.3-3-src.tar.bz2 46 c616cffee0f344c37fd4e045a7a87054

@ GCC is the package name. For example, this is the GCC tool.
Requires: the dependent package. For example, you can search @ cygwin to find the package information in this file.
Install: the location of the installed file.
Source: The source file address of the Program (we usually do not download it ).

In this way, you can save these files according to the directory structure on the website. Then run setup.exe to use local installation.

Question:
I don't like cygwin, because I think it's always like to make some changes in the registry.
As a matter of fact, if we really go deep into GCC programming, we will find that both mingw, cygwin, and djgpp are incomplete. So I am going to install a freebsd recently. The Windows may be abandoned in the future.
In the next article, I will continue to provide an in-depth introduction to the GCC for Win32 environment. It is of great help for you to have a deep understanding of GCC. In fact, many people have a misunderstanding of GCC, always think MS-C ++ how good. In fact, GCC is not worse than MS-C ++. After all, GCC is an excellent development environment in Linux, and the Linux kernel is compiled with GCC. Can MS-C ++ compile Win32 kernel? By the way, the Win32 kernel source file does not exist at all. Where can I compile it?

Studio software development group (SDT)
Studio development team
Dipper (Huang yaokui)

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.