ComputersSoftware

GCC Compiler for Windows

With the acronym GCC many people are familiar who are involved with software development. This compiler is a tool for developers who are committed to free software. Initially, this tool was created for Linux-systems. But there is also a GCC implementation for Windows. It's called MinGW.

History

Tools that are traditionally used to develop programs for open operating systems are the GNU tools. The project with this name was created by Richard Stallman in 1984. The need for it was due to the fact that in those days it was difficult to cooperate between program developers. This was due to the fact that owners of commercial programs arranged many obstacles to such cooperation. The goal of the project was to create a set of software, united by one license, which would not allow anyone to assign exclusive rights to such software. Part of this set is the tool for programmers - GCC. For Windows, the analog was created later.

What is a compiler?

It is worth explaining what kind of software it is. What is it for? In general, the GCC-compiler for Windows or Linux is a program that can convert the source code written by the programmer into machine code that a computer can understand. There is still such a thing as an "interpreter". Its functions are the same as those of the compiler, but it performs the translation line by line, not entirely. In this case, the program is converted to a bytecode - an intermediate form, which is a binary code. It is then interpreted during execution by a special virtual machine.

Development

Files containing source codes are created as simple text documents. They can be created using any simple text editor. In addition, you can use special development environments, in which editors are built-in. This tool is KDevelop. This is an environment that contains both the editor and the built-in console, which is located under the editor. The developer gets the opportunity in one program both to edit the code, and to give console commands without switching between windows.

Before creating a project, you need to create a directory, and in it already - a text document.

Features

GCC for Windows MinGW assigns by default all executable files that are created, the name is a.out. If you want to give a different name, you need to add the -o flag with the name to the compilation command. This is just one of many flags. In order to see everything, you need to type man gcc at the command line. For Windows, the command is the same as for Linux. The help system for the compiler appears before the user. Here you can see what each flag means. To exit the help system, press the Q key.

The work of GCC includes three stages:

  • Processing with a preprocessor;
  • compilation;
  • Layout.

At the first stage, the contents of the header files, which are specified in the directives at the beginning of the program, are included in the main file.

At the second stage the text of the program, written in the programming language, turns into a set of machine instructions, and the result is stored in the object file. It is worth noting that on different computers the format of this file may be different. That's why it's more convenient to distribute the programs in the form of source code so that they can be accessed for any architecture. This is what the GCC does. ARM, Windows, Intel, Unix - programs can run everywhere.

At the last stage all object files are linked into one. The result is the file to be launched.

Thus, GCC is a convenient tool for developers who are comfortable to use when creating programs.

Similar articles

 

 

 

 

Trending Now

 

 

 

 

Newest

Copyright © 2018 en.delachieve.com. Theme powered by WordPress.