{"id":292,"date":"2024-02-16T16:13:54","date_gmt":"2024-02-16T16:13:54","guid":{"rendered":"https:\/\/www.windlayer.com\/blog\/?p=292"},"modified":"2024-02-16T16:39:24","modified_gmt":"2024-02-16T16:39:24","slug":"how-to-install-c-gcc-compiler-for-windows","status":"publish","type":"post","link":"https:\/\/www.windlayer.com\/blog\/how-to-install-c-gcc-compiler-for-windows\/","title":{"rendered":"How to Install C\/GCC Compiler for Windows"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"292\" class=\"elementor elementor-292\" data-elementor-post-type=\"post\">\n\t\t\t\t<div class=\"elementor-element elementor-element-e149f6c e-flex e-con-boxed e-con e-parent\" data-id=\"e149f6c\" data-element_type=\"container\" data-settings=\"{&quot;content_width&quot;:&quot;boxed&quot;}\" data-core-v316-plus=\"true\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-b2f6482 elementor-widget elementor-widget-text-editor\" data-id=\"b2f6482\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<style>\/*! elementor - v3.19.0 - 07-02-2024 *\/\n.elementor-widget-text-editor.elementor-drop-cap-view-stacked .elementor-drop-cap{background-color:#69727d;color:#fff}.elementor-widget-text-editor.elementor-drop-cap-view-framed .elementor-drop-cap{color:#69727d;border:3px solid;background-color:transparent}.elementor-widget-text-editor:not(.elementor-drop-cap-view-default) .elementor-drop-cap{margin-top:8px}.elementor-widget-text-editor:not(.elementor-drop-cap-view-default) .elementor-drop-cap-letter{width:1em;height:1em}.elementor-widget-text-editor .elementor-drop-cap{float:left;text-align:center;line-height:1;font-size:50px}.elementor-widget-text-editor .elementor-drop-cap-letter{display:inline-block}<\/style>\t\t\t\t<p>The first and most important step for anyone interested in learning C programming on Windows is to set up a suitable development environment. Installing a C compiler is the fundamental step in this setup, and GCC (GNU Compiler Collection) is one of the most widely used options due to its reliability and popularity.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6b5de03 elementor-widget elementor-widget-text-editor\" data-id=\"6b5de03\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>The GNU Compiler Collection (GCC) is a collection of compilers that can be used run code written in a variety of languages, including C++, C, Fortran, and many more. The GNU Project created this open-source program, which can run on many different operating systems and platforms, such as Windows, iOS, Linux, PowerPC, and ARM-based embedded computers. Many error checking and debugging facilities are available in the GCC Compiler, which can save a great deal of time and effort.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b3c8116 elementor-widget elementor-widget-text-editor\" data-id=\"b3c8116\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Since GCC is cross-platform and supports a variety of operating systems and architectures, it is now commonly utilized by developers to create embedded systems and Internet of Things devices.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-4ae6d76 elementor-widget elementor-widget-text-editor\" data-id=\"4ae6d76\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Together, we can take this journey to enhance your programming efforts and create a smooth path for Windows C development.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-45e4728 elementor-widget elementor-widget-text-editor\" data-id=\"45e4728\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>To install the C\/GCC compiler (GNU Compiler Collection) on Windows, you can use MinGW (Minimalist GNU for Windows) or MSYS2 (Minimal System 2). Here are the steps for both methods:<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-3cce809 elementor-widget elementor-widget-heading\" data-id=\"3cce809\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<style>\/*! elementor - v3.19.0 - 07-02-2024 *\/\n.elementor-heading-title{padding:0;margin:0;line-height:1}.elementor-widget-heading .elementor-heading-title[class*=elementor-size-]>a{color:inherit;font-size:inherit;line-height:inherit}.elementor-widget-heading .elementor-heading-title.elementor-size-small{font-size:15px}.elementor-widget-heading .elementor-heading-title.elementor-size-medium{font-size:19px}.elementor-widget-heading .elementor-heading-title.elementor-size-large{font-size:29px}.elementor-widget-heading .elementor-heading-title.elementor-size-xl{font-size:39px}.elementor-widget-heading .elementor-heading-title.elementor-size-xxl{font-size:59px}<\/style><h2 class=\"elementor-heading-title elementor-size-default\">Installing C\/GCC Compiler on Windows using MSYS2<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-60c5e6b elementor-widget elementor-widget-text-editor\" data-id=\"60c5e6b\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>MinGW (Minimalist GNU for Windows) offers a number of publicly available and freely distributable Windows-specific header files and import libraries<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-e944266 elementor-widget elementor-widget-text-editor\" data-id=\"e944266\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Below are the steps for using MinGW:<\/p><p><strong>1) <\/strong><span style=\"text-decoration: underline;\"><strong>Download MinGW<\/strong><\/span><\/p><p>Visit the MinGW website (https:\/\/osdn.net\/projects\/mingw\/) to download the most recent MinGW Installation Manager version <strong>`mingw-get-setup.exe`<\/strong>.<br \/><br \/><\/p><p><strong>2) <\/strong><span style=\"text-decoration: underline;\"><strong>Run the Installer<\/strong><\/span><\/p><p>Run the installer <strong>`mingw-get-setup.exe`<\/strong> after downloading it.<br \/><br \/><\/p><p><strong>3) <\/strong><span style=\"text-decoration: underline;\"><strong>Components selection<\/strong><\/span><\/p><p>To install certain components, you&#8217;ll need to choose them in the installation manager. Make sure you have at least selected the C and C++ compilers from the <strong>`mingw32-base`<\/strong> and <strong>`mingw32-gcc-g++`<\/strong> packages.<br \/><br \/><\/p><p><strong>4)<\/strong> <span style=\"text-decoration: underline;\"><strong>Install<\/strong><\/span><\/p><p>Click &#8220;Install&#8221; or &#8220;Apply Changes&#8221; to continue with the installation.<br \/><br \/><\/p><p><strong>5) <\/strong><span style=\"text-decoration: underline;\"><strong>Set Environment Variables (Optional)<\/strong><\/span><\/p><p>Consider setting your system PATH environment variable to include the MinGW <strong>`bin`<\/strong> location after installation. This directory is typically found in <strong>`C:\\MinGW\\bin`<\/strong> by default.<br \/><br \/><\/p><p><strong>6) <\/strong><span style=\"text-decoration: underline;\"><strong>Installation verification<\/strong><\/span><\/p><p>Ensure that GCC has been installed correctly. Open the command prompt and type <strong>`<\/strong> <strong>gcc \u2013version`<\/strong>. After a successful installation, you should see the GCC version information.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-5241ce9 elementor-widget elementor-widget-heading\" data-id=\"5241ce9\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Installing C\/GCC Compiler on Windows using MinGW <\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-c3ad5a3 elementor-widget elementor-widget-text-editor\" data-id=\"c3ad5a3\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>MSYS2 (Minimal System 2) offers a powerful solution by providing a Unix-like environment for Windows, complete with a package manager to install essential development tools.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-67ac16c elementor-widget elementor-widget-text-editor\" data-id=\"67ac16c\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Below are the steps for using MSYS2:<\/p><p><strong>1) <\/strong><span style=\"text-decoration: underline;\"><strong>Download MSYS2<\/strong><\/span><\/p><p>Visit (https:\/\/www.msys2.org\/) and download the installer that is compatible with the architecture of your system (64-bit or 32-bit)<br \/><br \/><\/p><p><strong>2) <\/strong><span style=\"text-decoration: underline;\"><strong>Run the installer<\/strong><\/span><\/p><p>After the download is finished, run the installer to begin the installation process <strong>`msys2-x86_64.exe`<\/strong> for 64-bit or <strong>`msys2-i686.exe`<\/strong> for 32-bit).<br \/><br \/><\/p><p><strong>3) <\/strong><span style=\"text-decoration: underline;\"><strong>Install MSYS2<\/strong><\/span><br \/>Complete the installation by following the instructions provided by the installer on the screen.<br \/><br \/><\/p><p><strong>4) <\/strong><span style=\"text-decoration: underline;\"><strong>Update package database<\/strong><\/span><br \/>After installation, update the package database by running the following command on MSYS shell from the Start menu:<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-36cd03c elementor-widget elementor-widget-code-highlight\" data-id=\"36cd03c\" data-element_type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"prismjs-okaidia copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-javascript \">\n\t\t\t\t<code readonly=\"true\" class=\"language-javascript\">\n\t\t\t\t\t<xmp>pacman -Syu<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-29531b6 elementor-widget elementor-widget-text-editor\" data-id=\"29531b6\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p><strong><br \/>5) <span style=\"text-decoration: underline;\">Install GCC<\/span><\/strong><\/p><p>After the system has been updated, run the following command to install the GCC compiler:<\/p><p>For 64 Bit:<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-3f6cf0c elementor-widget elementor-widget-code-highlight\" data-id=\"3f6cf0c\" data-element_type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"prismjs-okaidia copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-javascript \">\n\t\t\t\t<code readonly=\"true\" class=\"language-javascript\">\n\t\t\t\t\t<xmp>pacman -S mingw-w64-x86_64-toolchain<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-5459d50 elementor-widget elementor-widget-text-editor\" data-id=\"5459d50\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p><br \/>For 32 Bit:<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-aecdd5e elementor-widget elementor-widget-code-highlight\" data-id=\"aecdd5e\" data-element_type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"prismjs-okaidia copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-javascript \">\n\t\t\t\t<code readonly=\"true\" class=\"language-javascript\">\n\t\t\t\t\t<xmp>pacman -S mingw-w64-i686-toolchain<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-0e8e914 elementor-widget elementor-widget-text-editor\" data-id=\"0e8e914\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p><strong><br \/>6) <span style=\"text-decoration: underline;\">Set Environment Variables (Optional)<\/span><\/strong><\/p><p>Consider setting your system PATH environment variable to include the MSYS2 <strong>`bin`<\/strong> location after installation. The default installation path is typically <strong>`C:\\msys64\\usr\\bin`<\/strong> for 64-bit and <strong>`C:\\msys32\\usr\\bin`<\/strong> for 32-bit.<br \/><br \/><\/p><p><strong>7) <span style=\"text-decoration: underline;\">Installation verification<\/span><\/strong><\/p><p>Ensure that GCC has been installed correctly. Open the command prompt and type <strong>` gcc \u2013version`<\/strong>. You should see the version information of GCC displayed, indicating a successful installation.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>The first and most important step for anyone interested in learning C programming on Windows is to set up a suitable development environment. Installing a C compiler is the fundamental step in this setup, and GCC (GNU Compiler Collection) is one of the most widely used options due to its reliability and popularity. The GNU [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":331,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-292","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorial"],"_links":{"self":[{"href":"https:\/\/www.windlayer.com\/blog\/wp-json\/wp\/v2\/posts\/292","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.windlayer.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.windlayer.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.windlayer.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.windlayer.com\/blog\/wp-json\/wp\/v2\/comments?post=292"}],"version-history":[{"count":37,"href":"https:\/\/www.windlayer.com\/blog\/wp-json\/wp\/v2\/posts\/292\/revisions"}],"predecessor-version":[{"id":330,"href":"https:\/\/www.windlayer.com\/blog\/wp-json\/wp\/v2\/posts\/292\/revisions\/330"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.windlayer.com\/blog\/wp-json\/wp\/v2\/media\/331"}],"wp:attachment":[{"href":"https:\/\/www.windlayer.com\/blog\/wp-json\/wp\/v2\/media?parent=292"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.windlayer.com\/blog\/wp-json\/wp\/v2\/categories?post=292"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.windlayer.com\/blog\/wp-json\/wp\/v2\/tags?post=292"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}