top of page

Compilers and IDEs

High Level Languages

High-level programming languages are vastly superior to lower level programming languages simply because of flexibility and ease of programming. Whereas low level languages are faster and closely represent machine code, they are much more complex to program. A compiler is used to take our high-level language source code which is human readable and easier to understand and convert it into machine code. When working with C, a compiler is used to convert C code into assembly language which is then assembled into object-code and converted into an exe. For the most part this is behind the scenes and will not matter to most, however it is important to know and mainly take away the notion of compilers and their importance.

Compilers / IDEs

To set up a compiler environment for our C code we have two main choices; Compile via the command line manually or compile in an integrated development environment (IDE). An IDE is an environment set up specifically for programming. There are many different IDEs with varying features ranging from beginner to advanced. Most notably IDEs are made to help you along the way, make your programming experience as efficient as possible, and spot errors that you may encounter.

gcc-logo.png

The most notable and used C compiler is GNU Compiler Collection (GCC). GCC is a command line tool which can be installed by following the GNU Projects official install guide or by installing it through Cygwin. To install with Cygwin first download the Cygwin setup package. After installing the core of Cygwin, a selection screen will popup allowing you to search for gcc-core and install it.

After creating a C code project (See next steps) it can be compiled in the terminal by using: gcc file.c -o output
More advanced operations can be done using GCC. Those will be shown later on.

As previously mentioned, there are a plethora of IDEs out there and finding the right one for you can be quite important. For complete beginners I recommend using Code::Blocks as it is clean and simple to understand and work with. For those dealing with more intermediate to advanced coding a richer feature set such as one supported by Visual Studio or the Eclipse IDE may be necessary.

eclipse-logo.png
codeblocks-logo.png
vs-logo.png

Code::Blocks

To set up Code::Blocks, first download it from the official website and run through the setup. Next, if one is not automatically detected, a compiler will have to be defined under settings --> compiler --> global compiler settings. A wide variety of compilers including the GNU GCC compiler as well as the Cygwin GCC compiler are supported. I would recommend installing the MinGW GCC compiler since it is easy and quick to install and works effectively with Code::Blocks. If it is not automatically detected change the Installation Directory in the Toolchain Executables tab of the compiler settings to; C:\Program Files (x86)\CodeBlocks\MinGW

codeblocks-setup.png

Codeblocks is now setup for use!

Visual Studio Code

Visual Studio Code is preferred over Visual Stuido for programming C code and integrates with it much more seamlessly. Visual Studio Code is the lightweight counterpart to Visual Studio. It is still packed with features and even faster to run. To set up Visual Studio Code first install it from the official Microsoft website. Install the TDM-GCC compiler from their GitHub page. Run through the setup and install the Recommended C/C++ tools. Now open Visual Studio Code and install the C/C++ extention by heading to Settings --> Extensions --> Search --> C/C++. Next install the Code Runner extension.

vs-code-setup.png

Visual Studio Code is now setup for use!

Visual Studio

Visual Studio is not recommended to use while learning C as it works better with even higher-level languages such as C++ and C#, but the option remains open. To set up a Visual Studio environment first install it from the official Microsoft website. The community edition is free, open-source, and has all the tools needed for an individual to program. When running through the installation a prompt will allow you to select which workloads you would like to work with. To support C code install the Desktop development with C++ workspace.

vs-setup.png

Visual Studio is now setup for use!

Eclipse

Eclipse is set up in a similar fashion. First install the Eclipse IDE from the official Eclipse site. Either the MinGW GCC or the Cygwin GCC compiler can be installed for setup. The compilers installed should be detected automatically but if they are not head to the Environment tab and set the path to your compiler.

eclipse-setup.png

Eclipse IDE is now set up for use!

Create a C file somewhere on your PC Ex: noot.c
 

Open it with the IDE of your choice. You are now ready to begin programming

  • Twitter
  • LinkedIn
  • discord-logo--v2
  • kisspng-github-pages-logo-repository-fork-github-logo-1-magentys-5b69de71b51265

Dragon Eye Intelligence LLC

bottom of page