C language compiler for windows. Selecting a development environment (IDE)


Last update: 18.05.2017

To create programs in C you need text editor, with which you can type the source code. And you also need a compiler that takes a C source code file and compiles it into an executable file.

As a compiler we will use the most popular gcc compiler today, which is available for different platforms. More information about GCC can be obtained on the official project website https://gcc.gnu.org/.

The GCC compiler suite is distributed in different versions. One of the most popular versions is the development kit from the non-profit project Mingw-w64. To install the corresponding compiler package, download the installer file from the link

When you run the installer, the following window will open:

Click on the Next button > and move on to the next step:

If the OS version is 64-bit, then in the Architecture field you should select x86_64. Leave the remaining settings as default and click on the Next > button. In the next step, we will indicate the path where the package will be installed:

You can leave the default settings. And after moving to the next step, the installation itself will begin.

After installation is complete, all the necessary files compilers. In my case they are on the way C:\Program Files (x86)\mingw-w64\i686-7.1.0-posix-dwarf-rt_v5-rev0\mingw32\bin:

Depending on the version of the package, the exact path may differ, but in any case, all files will be located in the path that was specified during the installation step.

In particular, the gcc.exe file will represent the compiler for the C language.

And add the path to the compiler:

So, the compiler is installed, and now we can write our first program. To do this you will need any text editor to type source code. You can use the popular Notepad++ editor or even the regular built-in Notepad.

So, let's create a folder on your hard drive for source files. And in this folder we will create new file, which we'll call hello.c .

In my case, the hello.c file is located in the C:\c folder.

Now let’s define the simplest code in the hello.c file that will output a line to the console:

#include // include the header file stdio.h int main(void) // define the main function ( // start of the function printf("Hello World! \n"); // print the line to the console return 0; // exit the function ) / / end of function

To output a line to the console, you need to connect the necessary functionality. To do this, at the beginning of the file there is a line

#include

The include directive includes the stdio.h header file, which contains the definition of the printf function, which is needed to output a line to the console.

The keyword int in the definition of the int main(void) function indicates that the function returns an integer. And the word void in parentheses indicates that the function does not take parameters.

The body of the main function is enclosed in braces(). In the body of the function, a line is output to the console using the printf function, to which the output string “Hello world!” is passed.

At the end, we exit the function using the return statement. Since the function must return an integer, the number 0 is indicated after return. Zero is used as an indicator of successful completion of the program.

After each action in the function, a semicolon is placed.

Now let's compile this file. For this we will open command line Windows and first use the cd command to navigate to the folder with the source file:

To compile the source code you need gcc compiler pass the hello.c file as a parameter:

After this, an executable file will be compiled, which in Windows is called a.exe by default. And we can access this file, and in this case the console will display the line “Hello World!”, in fact, as written in the code.

C is a simple procedural programming language general purpose. It is quite easy to learn. At the same time, it is powerful so that it can be used to create any computer program.

C++ is an object-oriented programming language that was originally created as a superset of C. C and C++ languages ​​are among the most popular technologies used for writing programs.

This article lists free C and C++ compilers for various operating systems.

Free C, C++ compilers and interpreters for computers

Open Watcom V2 Fork

It can run and create executable files under Windows ( 16-bit, 32-bit and 64-bit versions), Linux ( 32-bit and 64-bit versions), OS/2 and MS-DOS ( 16-bit and 32-bit modes). It's worth clarifying that Watcom was a well-known commercial compiler until the original developers stopped selling it and published the source code ( in accordance with the Sybase Open Watcom Public License).

For individual or beginner programmers Microsoft Visual Studio Community includes many important tools from the commercial versions of the project. You will have at your disposal an IDE, a debugger, an optimizing compiler, an editor, debugging and profiling tools. With this package you can develop programs for desktop and mobile versions Windows and also Android. The C++ compiler supports most of the features of ISO C++11, some of ISO C++14 and C++17. At the same time, the C compiler is already hopelessly outdated and does not even have proper C99 support.

The software also comes with support for building programs in C#, Visual Basic, F# and Python. At the time I wrote this article, the project's website stated that Visual Studio Community 2015 " free tool for individual developers, open source projects, scientific research, educational projects and small professional groups».

Clang: C programming language frontend for LLVM

Clang is a C, C++, Objective C and Objective C++ compiler developed for Apple. This is part of the LLVM project. Clang implements various standards ISO C and C++, such as C11, ISO C++ 11, C++ 14 and parts of C++ 1z.

It also supports extensions that can be found in the GNU family of C compilers. The C compiler for Windows is released under the BSD license. Unfortunately, at the time of writing this article, it is only available in original form, and you will have to assemble it yourself.

MinGW-w64

The MinGW-w64 project provides libraries, headers, required by the GNU C and C++ compilers to work in Windows system. In the case of MinGW-w64, these support files allow you to create 64-bit programs in addition to 32-bit . The project also provides cross-compilers so you can compile Windows program from a Linux system.

AMD x86 Open64 Compiler Suite

This is a version of the Open64 compiler suite (described below) that has been customized for AMD processors and has additional bug fixes. The C/C++ compiler complies with ANSI C99 and ISO C++98 standards, supports cross-language calls ( since it includes a Fortran compiler), 32-bit and 64-bit x86 code, vector and scalar code generation SSE/SSE2/SSE3, OpenMP 2.5 for shared memory models, MPICH2 for distributed and shared memory models; contains an optimizer that supports great amount optimizations ( global, loop-node, interprocedural analysis, feedback) and much more. The set comes with optimized AMD Core Math Library and documentation. This set of compilers requires Linux.

Compiler C/C++ Open Source Watcom / Open Watcom

It is a free and open source compiler for Windows 7. It generates code for Win32, Windows 3.1 (Win16), OS/2, Netware NLM, MSDOS ( 16-bit and 32-bit mode) etc. Watcom was a very popular compiler a few years ago until Sybase shut it down. It also includes the rather famous STLport ( implementation of the C++ standard template library). Update: This project appears to have stalled and is currently running new project Open Watcom V2 Fork (described above).

Digital Mars C/C++ Compiler (Symantec C++ replacement)

Digital Mars C/C++ is a replacement for Symantec C++ with support for compiling programs for Win32, Windows 3.1, MSDOS, and 32-bit extended MSDOS. If the PC you are using does not have a floating point processor ( pre-Pentium machines), you can associate floating point emulation in your program. The compiler supports the definition of C++ from the Annotated C++ Manual ( ARM) and advanced features of the AT&T language version 3.0, including templates, nested classes, nested types, exception handling, and run-time type identification.

UPS Debugger (C interpreter)

It is a graphical source-level debugger for X Window, which contains a built-in C language interpreter. It can process one or more source files. You can use it to create executable file with byte code and execute the interpreter in this executable file. If you need an interpreter for debugging or prototyping programs, or just to learn a language, try this tool. It supports the following platforms: Solaris, SunOS, Linux, FreeBSD, BSD/OS and some other Unix platforms.

The BDS C Compiler

Remember the old (popular) C BDS compiler for CP/M 8080/Z80 systems? Currently this C compiler is in public access, complete with assembly language source code. The package is a retail version of the compiler with a linker and user manual. It can be used to easily generate 8080/8085/Z80 code for embedded systems ( that is, create your own routines to replace any library code that accesses operating system functions).

C/C++ Compiler Bloodshed Dev

It is a Win32 IDE that includes the C++ egcs compiler and the GNU debugger from the Mingw32 environment. As well as an editor and other tools that facilitate the development of programs using the Mingw32 gcc compiler on Windows platform. It also contains an installer for applications.

C Orange Compiler

It runs on both Windows and DOS, and has an integrated development environment with a program editor ( with syntax highlighting and automatic code completion). It can generate programs for Win32 and MSDOS, as well as Intel and Motorola hex files ( which is useful if you write programs for embedded systems). To output MSDOS, your programs will use the DOS extender.

DeSmet C

DeSmet C should be familiar to those who programmed C in the 1980s. This is a C compiler for MSDOS. It was released under the GNU GPL license and comes with tutorials, an editor, and a third-party optimizer.

Apple Xcode for Mac OS X

Xcode is an integrated environment Apple development, which includes an editor with syntax highlighting, a build management system, a debugger, the GNU C compiler (gcc), an interface designer, AppleScript Studio, support for Java development, and WebObjects development tools. To receive these tools, you must be a member Apple Developer Connection (ADC). But online membership is free.

Tiny C Compiler - the most compact Linux C compiler

This small C compiler for Linux and Windows generates optimized binary files x86. It claims to build, link, and link code several times faster than GCC. IN currently developers strive to ensure compliance with ISO C99. The compiler also includes an optional bounds check. It processes C script files ( just add to Linux shebang code #!/usr/local/bin/tcc -run to the first line of the C source code so that it is executed directly). TCC is licensed under the GNU General Public License.

Portable Object Compiler

It is a set of class libraries and an Objective C compiler that converts Objective C code into plain C code. Works on Windows, Linux, OS/2, Macintosh, etc.

C & C++ compilers Mingw32

This system comes with the GNU C/C++ compiler, which can be used to create Win32 executables. It contains its own , which is located in open access. Applications built using this system are expected to be faster than those built using Cygwin32, and are not limited by the terms of the GNU license. Mingw32 comes with text processing tools ( sed, grep), lexical analyzer generator ( flex), parser generator ( bison), etc. Mingw32 also comes with the Windows Resource Compiler.

GNU C/C++ Compiler

The GNU C Compiler page provides links to binaries and source code for the GNU C compiler. You can also use the links provided in this article to the most frequently requested binary versions ( MSDOS and Win32).

C Pelles Compiler

Another C compiler based on LCC ( see also LCC-Win32). It includes a C compiler, linker, resource compiler, message compiler, make utility, and other tools. It compiles code for Windows and Pocket PC.

Compaq C Compiler

Linux/Alpha users can now download and use the Compaq compiler for free by simply filling out a form and accepting the license agreement. A compiler can be used to generate any program, commercial or otherwise. It includes a math library and debugger ( ladebug), ported from True64 Unix. It comes with the usual man pages, as well as a language reference and a programmer's guide.

C/C++ Ch Embeddable Interpreter (standard version)

C/C++ interpreter that supports the ISO 1990 C standard ( C90), core C99 functions, C++ classes, and extensions to the C language such as nested functions, string type, etc. It can be embedded in other applications and hardware, used as a scripting language. C/C++ code is interpreted directly without compiling intermediate code. Since this interpreter supports Linux, Windows, MacOS X, Solaris, and HP-UX, the code you create can be ported to any of these platforms. Standard version free for personal, academic and commercial use. To download the package you must register.

C and C++ compilers DJGPP

It is a development system based on the well-known GNU C/C++ compiler. It generates 32-bit MSDOS executables, which are files with long Windows names 95. This is very functional system with IDE, graphic libraries, lexical analyzer generators ( flex), parser generators ( bison), text processing utilities, and so on. A C language compiler, utilities and libraries are supplied with the source code.

Cilk - ANSI C-based compiler

Cilk is an ANSI C-based language that can be used for multi-threaded parallel programming. This is especially effective for exploiting dynamic, highly asynchronous parallelism in the data-parallel or message-passing style. The official website mentions that Cilk is already used to develop three world-class chess programs: StarTech, Socrates and Cilkchess.

Sphinx - C compiler -

It's sort of a combination of a C compiler and an assembler that allows " create programs with the power and readability of C while maintaining the efficiency of assembly language" It can create MSDOS executables or .OBJ files, which can be used in conjunction with other linkers to create an executable file. The source code and documentation for the compiler can be found at the link above. If you want to get a pre-compiled binary, you can do so at unofficial site of the C compiler - Sphinx.

LSI C-86 C Compiler

The website of this compiler is written in Japanese. It looks like a cross-compiler that allows you to generate code for ROMs. Old version compiler ( 3.30c) is provided free of charge. The free version only works on MSDOS.

Cross-compiler C SDCC

It is a C cross-compiler designed for Intel 8051, DS390, Z80, HC08 and PIC microprocessors. It can also be repurposed for other 8-bit microcontrollers or PICs. SDCC comes with a reconfigurable assembler and linker, a source-level debugger, and a simulator. The libraries are compatible with the C99 standard. The source code for the compiler is available under GPL license. Platforms supported include Linux, Windows, Mac OS X, Alpha, Sparc and others.

C compiler LADSoft CC386

It is an ANSI C compiler for MSDOS/DPMI and Win32, which comes with a runtime library, linker, debugger, DOS extender (version MSDOS), IDE (version Win32) and the make utility. Source code is also available. When running in C99 compatibility mode, it compiles most C99 constructs.

Cygwin Project (C and C++ compilers)

This "project" includes a commercial compiler ( GNU C/C++), which generates Win32 GUI and console applications. Source code for the compiler, libraries, and tools is provided. Note that the default option in this package requires you to distribute the source code if you compile and link your libraries. There is also a special callable option that specifies the ability to communicate with alternative libraries, allowing you to distribute your applications without sources.

C Compiler LCC-Win32

It is a C compiler for Windows that generates Win32 GUI and console applications. It comes with its own linker, IDE, debugger, editor, and resource compiler. LCC-Win32 is based on the LCC compiler and is free for non-commercial use only.

LCC - redirectable compiler for ANSI C

LCC is a C compiler ( source code only), which generates code for Alpha, Sparc, MIPS R3000 and Intel x86. It is the basis for at least two other Win32 C compilers ( also described above).

Cyclone C

Cyclone C is not an ANSI C compiler in the strict sense, but is a " safe dialect» C . It provides type safety, has many checks to protect against buffer overflows, array violations, etc. It currently runs on Linux and Windows ( in the latter case via Cygwin), it requires the GNU compilation tools to be present on the system.

Leonardo IDE

It is a Macintosh-based IDE, compiler and debugger for C programs. It includes an editor with syntax highlighting, an ANSI C compiler, a compiler for the ALPHA visualization language, a graph editor, an invertible virtual processor, etc.

Please note that the programs are in code that will be executed for the virtual CPU. The virtual machine and debugger allow you to run code forward and backward and support multitasking. The IDE comes with animated algorithms, sample source code for games such as Tetris, Checkers and others. The IDE is useful for inspecting and debugging source code, finding processes that are using memory inefficiently, etc.

Note: This project has been discontinued.

Turbo C 2.01

The old but proven Turbo C 2.01 for DOS is available free of charge by the decision of new Borland owners. It was a popular compiler C To compile or not? It is almost impossible to answer this question. If you want to learn to program for professional purposes, then a good idea would be...

Almost all developers sooner or later face the need to run or quickly check some code, but not everyone knows that for such a simple task it is not at all necessary to run heavy desktop IDEs or application compilers. It is enough to use online tools that allow you to do everything much faster: Ctrl+C, Ctrl+V, Run, whack - and the output of the program is already before your reddish eyes.

We have selected the best online compilers: some of them are quite universal, others are tailored for strictly defined tasks. In any case, they will not be superfluous.

Koding

Koding.com is not an online compiler in the traditional sense. Each service user can create several full-fledged virtual machines under Ubuntu management 14.04, on which he can do whatever he wants, including compiling the code. All popular languages ​​are supported by default, but you can easily add your own.

In addition to the control panel for your server, a convenient IDE and a terminal window are available in the interface. Koding is the most universal tool; next we will look at simpler and more specialized options.

IdeaOne

IdeOne is an online compiler and debugging tool that allows you to run code in over 60 programming languages ​​and their specific versions directly in the browser.

For those who do not have a girlfriend, the creators have provided code compilation in the Brainfuck language.

JDoodle

Another online compiler that supports many languages, including some that you won't find in many other online compilers. A nice feature of JDoodle is the ability collaboration- just send a link to your current session and generate bugs at double speed!

jsFiddle

Don't let the name fool you - jsFiddle isn't just built for JavaScript. This online front-end editor allows you to test any combination of JavaScript, HTML and CSS. Of course, there is support for various frameworks, for example, jQuery, Vue, React, TypeScript, as well as CSS preprocessors like SCSS. For convenience, you can select a key binding from your favorite editor. True, only if your favorite editor is Vim, Emacs or Sublime Text.

CodePad

CodePad is a minimalistic service in which you can store code, share it, and run it with subsequent output of the results of its execution. There are several of the most common languages ​​to choose from, but, unfortunately, no choice of specific versions of interpreters or compilers.

Its main advantage is simplicity and ease: the site will work quickly even with slow internet. Auto-connection of standard headers is provided, as well as integration with Vim or Emacs.

One of the disadvantages is the complete lack of syntax highlighting when entering code into the form. However, when viewing an already saved recording, the backlight is present.

GCC GodBolt

GCC GodBolt is an interactive C++ compiler. I got into this collection for the reason that it has a simple interface, as well as a large number of settings, including options that can be adjusted using keys.

There are many compiler versions to choose from, including the latest ones. From interesting features You can note the instant translation of the program code into assembly language.

There is often a need to quickly show someone how to solve small task on programming or how to implement an algorithm. You can simply respond with a piece of code, but it’s better to use one of the online compilers.

Many of them have the ability to get a special link to the compiled code. For example, you can leave such a link in the comments to articles. After going through it, people will see not only the code itself, but also the result of the program.

Let's consider several options for online compilers supporting the C++ programming language

1. Online compiler for C++ on primat.org. Add the code, click RUN and wait for execution.

If the program requires user actions during operation, we perform them:

If errors occur, they will be displayed in the compilation tab, which will open automatically. In the options tab, you can select various parameters for compilation if you are not satisfied with the default ones.

There is also a compiler for Pascal on this site.

2.

Immediately upon entering, pay attention to the programming language that is selected by default. Change it if necessary. Enter the incoming data into stdin:

There is a very large selection of languages ​​for compilation:

3. Online compiler Wandbox

Incoming data must be written to Stdin before clicking Run.

I liked that it stores the compilation history. In addition to C++ there is wide choose programming languages ​​for compilation:

4. C/C++ Online Compiler

What free C++ compilers and IDEs exist for them?

Compilers:

1) gcc. Under windows is better Just use MinGW, this is a port of gcc on the Windows platform.

2) Visual C++ 2005 Express Edition. Direct download links: www.rsdn.ru/Forum/Message.aspx?mid=1477837#1477837

3) Digital Mars C/C++ Compilers. Quite a good compiler, but less compliant with the standard than the latest gcc or VC7.1.

4) Borland free compiler. Contains a compiler and command line utilities.

5) Open Watcom C/C++.

6) LCC-Win32 (C compiler only, C++ does not support).

7) Microsoft Visual C++ Toolkit 2003. Full-fledged VC7.1 optimizing compiler without IDE and nmake. Currently replaced by Visual C++ 2005 Express Edition and is not available from the Microsoft website, use the search. May be more preferable due to low weight (~30 MiB).

IDE:

1) Dev-C++. Quite a good IDE for gcc(mingw). Currently being developed as wxDev-C++ due to integration with the wxWidgets GUI development system.

2) MinGW Developer Studio - IDE is designed specifically for use with MinGW. It is very convenient for those who develop a program for Windows and Linux at the same time, because The project format is the same and all that remains is to click on the compilation button and not have to worry about setting up different environments.

3) Code::Blocks IDE. This is probably one of the best (albeit the youngest) IDE for free compilers, supports not only MinGW, but also Microsoft Visual C++ Toolkit 2003, Digital Mars C/C++ Compilers, Borland free compiler, Open Watcom C/C++ and Small Device C Compiler

4) Eclipse/CDT - written in Java, platform for IDE development+ plugin that turns the platform into an environment adapted for C++. Information about the plugin Download a ready-made IDE

5) Emacs/Vim. Not for the faint of heart, long learning curve. Advantages: cross-platform and power and flexibility unmatched by other tools. Vim official website. Emacs: - official ftp - good distribution for Windows

6) eVC 3/4 Free IDEs from Microsoft for the WinCE platform. www.microsoft.com

7) Visual-MinGW. Distributed under the GNU license. The IDE shell is very similar to Microsoft Visual C++ 6

8) Visual Studio 2005 Express - a free version of MSVC 2005. It has a full-fledged C++ compiler and, together with the Platform SDK and DXSDK, provides enough opportunities for writing games. Distribution size ~450 MB.

9) Visual Studio 2008 Express. Comes complete with reduced size Windows version SDK (previously called Platform SDK) containing only the headers, libraries and core utilities, so there is no longer a need to download the Platform SDK separately.

10) NetBeans IDE. A free IDE from Sun Microsystems, written in Java, and therefore, like Eclipse, requires a JVM on the user's computer. Supports many languages, including Chile and C++. You can download either a distribution specifically for working with C++, or expand the already installed environment using a plugin. Mainly supports work with the MinGW compiler. Provides extensive capabilities for automatic code refactoring. Those using several compilers at once are also recommended to look at Scons and Boost.Build - convenient systems for building projects.







2024 gtavrl.ru.