Nov 29, 2016 Download Dev-C for free. A free, portable, fast and simple C/C IDE. I am glad to see MS Visual Studio-compared power on top of open source gcc compiler. IOS, Android and Linux Server., using the same native code base. RAD Studio 10.3.2 makes significant improvements for C developers including C17 Win64 support. TDM-GCC contains compilers based on MinGW64/TDM-GCC. These compilers can create both 32bit and 64bit executables and generally ship with much more Microsoft related headers and libraries. When you place these compilers in Dev-Cpp MinGW64, Dev-C can automatically configure them on first launch or via Tools Compiler Options Find Compilers.
GCC is a very good compiler collection, and is fully free (in speech and beer). There are however a ton of Windows distributions spread over the internet, but only some are of high quality. There's a lot of choices to be made as well, so I've made all those for you so you don't have to worry, and get good defaults.
We will use the MinGW-w64 port packaged with MSYS2. This also allows us to use *nix toolchains to build other libraries, as well as use the precompiled libraries that MSYS2 provides. Note that MSYS2 provides MinGW-w64 compilers. Binaries with these compilers will be standalone, and do not require a
cygwin.dll
or similar file.- Virtual Hackerspace and Resources for Software Developers of all Skill Levels. If you want to write a C program that utilizes Sqlite3 you will need to take an extra step in the compile and link process in order to compile Sqlite3 with the C compiler (gcc), and then your C program with the C compiler (g) If you try to compile Sqlite3.
- Nov 29, 2016 SolarWinds® Security & Event Manager (SEM) is designed to deliver comprehensive Security Information and Event Management (SIEM) capabilities in a highly affordable, easy-to-use, and quick-to-deploy virtual appliance.
I assume your development machine is 64-bit, and you want your compiler to target 64-bit windows by default. We will install both a 32-bit and a 64-bit target compiler toolchain, regardless.
If you have a 32-bit development machine, change every occurrence of
C:devmsys64
with C:devmsys32
below. However, it's <current year>
, get a 64-bit machine.- Download msys2-x86_64-latest.exe and run it. If your development machine is 32-bit, download msys2-i686-latest.exe instead. Make sure to set the install directory to
C:devmsys64
(C:devmsys32
for 32-bit). Choose to run MSYS2 right now. - In the MSYS2 shell, execute the following. Hint: if you right click the title bar, go to Options -> Keys and tick 'Ctrl+Shift+letter shortcuts' you can use Ctrl+Shift+V to paste in the MSYS shell.
- Close the MSYS2 shell once you're asked to. There are now 3 MSYS subsystems installed: MSYS2, MinGW32 and MinGW64. They can respectively be launched from
C:devmsys64msys2.exe
,C:devmsys64mingw32.exe
andC:devmsys64mingw64.exe
. If the installer created any shortcuts to open shells for these subsystems, you can update them to these locations to get pretty icons. Each subsystem provides an environment to build Windows applications. The MSYS2 environment is for building POSIX compliant software on Windows using an emulation layer. The MinGW32/64 subsystems are for building native Windows applications using a linux toolchain (gcc, bash, etc), targetting respectively 32 and 64 bit Windows. We will install ourPATH
such that these tools can be called from regular cmd.exe as well, and we need only use the MinGW subsystem to install/update MSYS2 packages or if our build setup requires a *nix shell. Hint: after starting up MSYS2, the prompt will say which version you launched. - Reopen MSYS2 (doesn't matter which version, since we're merely installing packages). Repeatedly run the following command until it says there are no further updates. You might have to restart your shell again.
- Now that MSYS2 is fully up-to-date we will install GCC and common build tools. When you are queried to select packages and confirm the installation just press enter:
- Add
C:devmsys64mingw64bin
andC:devmsys64mingw32bin
, in that order, to yourPATH
. Note that MSYS2 also puts a lot of other tools in this directory, most notably Python. So put these entries below any other tools you might have installed in your PATH.
Done. Now you can use
gcc
, g++
, etc to get your 64-bit targeting compiler from your regular command line. To make 32-bit binaries, use i686-w64-mingw32-g++
and co.To be safe and reproducible, MSYS2 by default disables inheriting your
PATH
settings in their environments. You can toggle this option per environment by looking in the respective .ini
file in C:devmsys64
for MSYS2_PATH_TYPE=inherit
. My recommendation is to inherit the path for the MinGW32/64 environments, but keeping the MSYS environment pure.The instructions below are an example of installing a library, this part is not required.
First and foremost I suggest checking the package manager of MSYS2. It has a lot of pre-built library packages. You can search the package repository using
pacman -Ss your_library
, for example:If the package name starts with mingw, it's a library. Install it using
pacman -Sy package_name
, e.g.:Sadly there is no wildcard, but you can use
pacman -Sy `pacman -Ssq boost`
to install everything returned by a search.If your library is not in the package manager you must compile it yourself. As an example, we'll try and build the 64-bit zlib library (this is an excercise - zlib is installed already by default):
- Open
mingw64.exe
(and if not already, cd to~
). - Download and unpack zlib:
- Configure, compile and install:
GCC is a very good compiler collection, and is fully free (in speech and beer). There are however a ton of Windows distributions spread over the internet, but only some are of high quality. There's a lot of choices to be made as well, so I've made all those for you so you don't have to worry, and get good defaults.
We will use the MinGW-w64 port packaged with MSYS2. This also allows us to use *nix toolchains to build other libraries, as well as use the precompiled libraries that MSYS2 provides. Note that MSYS2 provides MinGW-w64 compilers. Binaries with these compilers will be standalone, and do not require a
cygwin.dll
or similar file.I assume your development machine is 64-bit, and you want your compiler to target 64-bit windows by default. We will install both a 32-bit and a 64-bit target compiler toolchain, regardless.
If you have a 32-bit development machine, change every occurrence of
C:devmsys64
with C:devmsys32
below. However, it's <current year>
, get a 64-bit machine.- Download msys2-x86_64-latest.exe and run it. If your development machine is 32-bit, download msys2-i686-latest.exe instead. Make sure to set the install directory to
C:devmsys64
(C:devmsys32
for 32-bit). Choose to run MSYS2 right now. - In the MSYS2 shell, execute the following. Hint: if you right click the title bar, go to Options -> Keys and tick 'Ctrl+Shift+letter shortcuts' you can use Ctrl+Shift+V to paste in the MSYS shell.
- Close the MSYS2 shell once you're asked to. There are now 3 MSYS subsystems installed: MSYS2, MinGW32 and MinGW64. They can respectively be launched from
C:devmsys64msys2.exe
,C:devmsys64mingw32.exe
andC:devmsys64mingw64.exe
. If the installer created any shortcuts to open shells for these subsystems, you can update them to these locations to get pretty icons. Each subsystem provides an environment to build Windows applications. The MSYS2 environment is for building POSIX compliant software on Windows using an emulation layer. The MinGW32/64 subsystems are for building native Windows applications using a linux toolchain (gcc, bash, etc), targetting respectively 32 and 64 bit Windows. We will install ourPATH
such that these tools can be called from regular cmd.exe as well, and we need only use the MinGW subsystem to install/update MSYS2 packages or if our build setup requires a *nix shell. Hint: after starting up MSYS2, the prompt will say which version you launched. - Reopen MSYS2 (doesn't matter which version, since we're merely installing packages). Repeatedly run the following command until it says there are no further updates. You might have to restart your shell again.
- Now that MSYS2 is fully up-to-date we will install GCC and common build tools. When you are queried to select packages and confirm the installation just press enter:
- Add
C:devmsys64mingw64bin
andC:devmsys64mingw32bin
, in that order, to yourPATH
. Note that MSYS2 also puts a lot of other tools in this directory, most notably Python. So put these entries below any other tools you might have installed in your PATH.
Done. Now you can use
gcc
, g++
, etc to get your 64-bit targeting compiler from your regular command line. To make 32-bit binaries, use i686-w64-mingw32-g++
and co.To be safe and reproducible, MSYS2 by default disables inheriting your
PATH
settings in their environments. You can toggle this option per environment by looking in the respective .ini
file in C:devmsys64
for MSYS2_PATH_TYPE=inherit
. My recommendation is to inherit the path for the MinGW32/64 environments, but keeping the MSYS environment pure.The instructions below are an example of installing a library, this part is not required.
First and foremost I suggest checking the package manager of MSYS2. It has a lot of pre-built library packages. You can search the package repository using
pacman -Ss your_library
, for example:Dev C Update Gcc 2017
If the package name starts with mingw, it's a library. Install it using
pacman -Sy package_name
, e.g.:Sadly there is no wildcard, but you can use
pacman -Sy `pacman -Ssq boost`
to install everything returned by a search.Dev C++ Update Gcc Download
If your library is not in the package manager you must compile it yourself. As an example, we'll try and build the 64-bit zlib library (this is an excercise - zlib is installed already by default):
Dev C Compiler
- Open
mingw64.exe
(and if not already, cd to~
). - Download and unpack zlib:
- Configure, compile and install: