<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.codeblocks.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Brothernorth</id>
	<title>Code::Blocks - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.codeblocks.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Brothernorth"/>
	<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php/Special:Contributions/Brothernorth"/>
	<updated>2026-05-03T05:42:19Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.0</generator>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Fortran_support_in_Code::Blocks&amp;diff=2863</id>
		<title>Fortran support in Code::Blocks</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Fortran_support_in_Code::Blocks&amp;diff=2863"/>
		<updated>2006-04-27T00:23:29Z</updated>

		<summary type="html">&lt;p&gt;Brothernorth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Installation\Build Instructions]]&lt;br /&gt;
== Attaching the compiler framework ==&lt;br /&gt;
To attach the GNU Fortran 77 Compiler (G77) the following steps are required:&lt;br /&gt;
* Make a copy of the GNU GCC compiler as follows:&lt;br /&gt;
&lt;br /&gt;
1.) Goto menu &amp;quot;Settings&amp;quot; -&amp;gt; &amp;quot;Compiler&amp;quot;&lt;br /&gt;
&lt;br /&gt;
2.) Select the &amp;quot;GNU GCC Compiler&amp;quot;, click the &amp;quot;Copy Button&amp;quot;&lt;br /&gt;
&lt;br /&gt;
3.) Save the copy e.g. under &amp;quot;GNU G77 Compiler&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* Setup the compiler as follows:&lt;br /&gt;
&lt;br /&gt;
1.) The path etc. should be as of the GCC Compiler. If this has been setup correctly, no changes are required. Otherwise refer to the setup of the GNU GCC compiler.&lt;br /&gt;
&lt;br /&gt;
2.) Change under the &amp;quot;Programs&amp;quot; tab: &amp;quot;C compiler&amp;quot; =  &amp;quot;g77.exe&amp;quot;, &amp;quot;Linker for dynamic libs&amp;quot;: &amp;quot;g77.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
3.) In the &amp;quot;Linker&amp;quot; tab add &amp;quot;-lg2c&amp;quot; (and &amp;quot;-lstdc++&amp;quot; if you have mixed Fortran/C++ projects) under &amp;quot;Other linker options&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* Important: Make sure the path environment is setup to really point a path that contains the Fortran compiler suite. C::B with MinGW does '''NOT''' include the Fortran compiler. You may download the compiler under [http://www.mingw.org MinGW webpage]. &amp;quot;gcc-g77-3.4.2-20040916-1.tar.gz&amp;quot; is the name of the package I expect you want.&lt;br /&gt;
&lt;br /&gt;
== Adding new Fortran file type ==&lt;br /&gt;
It makes sense to add a new &amp;quot;Fortran Sources&amp;quot; filetype to have the Fortran source code files being seperated. Steps to do so:&lt;br /&gt;
* Goto menu &amp;quot;Project&amp;quot; -&amp;gt; &amp;quot;Project tree&amp;quot; -&amp;gt; &amp;quot;Edit file types categories&amp;quot;&lt;br /&gt;
* Click on &amp;quot;Add&amp;quot; to add a new type of files&lt;br /&gt;
* Select &amp;quot;Fortran Sources&amp;quot; as group name&lt;br /&gt;
* Enter the following in the file-mask (without quotation marks): &amp;quot;*.f;*.f77;*.cmn;*.inc;&amp;quot;&lt;br /&gt;
* Click OK to close the dialog.&lt;br /&gt;
For your interest: &amp;quot;*.f;*.f77&amp;quot; are normally the default extensions for source code files, &amp;quot;*.cmn&amp;quot; is the extension for Fortran common-blocks and &amp;quot;*.inc&amp;quot; if often used as include file with e.g. variable declarations.&lt;br /&gt;
&lt;br /&gt;
== Setting up Fortran projects ==&lt;br /&gt;
To work with Fortran files, do the following:&lt;br /&gt;
Add a (new) file to the project, saved as &amp;quot;your_fortran_file.f&amp;quot;. Verify it's recognised as &amp;quot;Fortran Sources&amp;quot; file type. If not verify you have done the steps above correctly. To enable compiling the project which includes Fortran files follow these steps:&lt;br /&gt;
* Right click on the project, select &amp;quot;Build options&amp;quot; and make sure you have selected the &amp;quot;GNU G77 compiler&amp;quot; (see steps above).&lt;br /&gt;
* Right click on the &amp;quot;your_fortran_file.f&amp;quot; file and select &amp;quot;Properties&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
1.) Enable &amp;quot;Compile file&amp;quot; and &amp;quot;Link file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2.) Under the &amp;quot;Advanced&amp;quot; tab enter &amp;quot;CC&amp;quot; as compiler variable&lt;br /&gt;
&lt;br /&gt;
* Compile the project, it should work by now.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
For troubleshooting enable the &amp;quot;Full command line&amp;quot; Under menu &amp;quot;Settings&amp;quot; -&amp;gt; &amp;quot;Compiler&amp;quot; -&amp;gt; &amp;quot;Other&amp;quot; tab, &amp;quot;Compiler logging&amp;quot;. If you see that still the gcc compiler is invoked, make sure you setup the right compiler in the build options for your project '''AND''' your target (e.g. &amp;quot;default&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
== Using gfortran instead of g77 ==&lt;br /&gt;
The preceding steps can also be used to set up Code::Blocks to use the GNU gfortran Fortran '95 compiler, albeit with the following changes:&lt;br /&gt;
&lt;br /&gt;
* Setup the compiler as follows:&lt;br /&gt;
&lt;br /&gt;
1.) The &amp;quot;Compiler's installation directory&amp;quot; should point to the location of the root directory of the gfortran installation, for example if gfortran.exe is located in C:\gfortran\bin the path should read &amp;quot;C:\gfortran&amp;quot; (minus quotes).&lt;br /&gt;
&lt;br /&gt;
2.) Under the &amp;quot;Programs&amp;quot; tab, select &amp;quot;gfortran.exe&amp;quot; as both the C compiler and the linker for dynamic libs instead of &amp;quot;g77.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
3.) DO NOT add the linker commands as given previously; leave these fields blank.&lt;br /&gt;
&lt;br /&gt;
* Adding new Fortran file type&lt;br /&gt;
Proceed as above, but add &amp;quot;*.f95&amp;quot; as a file type instead of &amp;quot;*.f77&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Follow the rest of the steps above and gfortran should work.&lt;/div&gt;</summary>
		<author><name>Brothernorth</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Fortran_support_in_Code::Blocks&amp;diff=2862</id>
		<title>Fortran support in Code::Blocks</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Fortran_support_in_Code::Blocks&amp;diff=2862"/>
		<updated>2006-04-27T00:17:26Z</updated>

		<summary type="html">&lt;p&gt;Brothernorth: /* Using gfortran instead of g77 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Installation\Build Instructions]]&lt;br /&gt;
== Attaching the compiler framework ==&lt;br /&gt;
To attach the GNU Fortran 77 Compiler (G77) the following steps are required:&lt;br /&gt;
* Make a copy of the GNU GCC compiler as follows:&lt;br /&gt;
&lt;br /&gt;
1.) Goto menu &amp;quot;Settings&amp;quot; -&amp;gt; &amp;quot;Compiler&amp;quot;&lt;br /&gt;
&lt;br /&gt;
2.) Select the &amp;quot;GNU GCC Compiler&amp;quot;, click the &amp;quot;Copy Button&amp;quot;&lt;br /&gt;
&lt;br /&gt;
3.) Save the copy e.g. under &amp;quot;GNU G77 Compiler&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* Setup the compiler as follows:&lt;br /&gt;
&lt;br /&gt;
1.) The path etc. should be as of the GCC Compiler. If this has been setup correctly, no changes are required. Otherwise refer to the setup of the GNU GCC compiler.&lt;br /&gt;
&lt;br /&gt;
2.) Change under the &amp;quot;Programs&amp;quot; tab: &amp;quot;C compiler&amp;quot; =  &amp;quot;g77.exe&amp;quot;, &amp;quot;Linker for dynamic libs&amp;quot;: &amp;quot;g77.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
3.) In the &amp;quot;Linker&amp;quot; tab add &amp;quot;-lg2c&amp;quot; (and &amp;quot;-lstdc++&amp;quot; if you have mixed Fortran/C++ projects) under &amp;quot;Other linker options&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* Important: Make sure the path environment is setup to really point a path that contains the Fortran compiler suite. C::B with MinGW does '''NOT''' include the Fortran compiler. You may download the compiler under [http://www.mingw.org MinGW webpage]. &amp;quot;gcc-g77-3.4.2-20040916-1.tar.gz&amp;quot; is the name of the package I expect you want.&lt;br /&gt;
&lt;br /&gt;
== Adding new Fortran file type ==&lt;br /&gt;
It makes sense to add a new &amp;quot;Fortran Sources&amp;quot; filetype to have the Fortran source code files being seperated. Steps to do so:&lt;br /&gt;
* Goto menu &amp;quot;Project&amp;quot; -&amp;gt; &amp;quot;Project tree&amp;quot; -&amp;gt; &amp;quot;Edit file types categories&amp;quot;&lt;br /&gt;
* Click on &amp;quot;Add&amp;quot; to add a new type of files&lt;br /&gt;
* Select &amp;quot;Fortran Sources&amp;quot; as group name&lt;br /&gt;
* Enter the following in the file-mask (without quotation marks): &amp;quot;*.f;*.f77;*.cmn;*.inc;&amp;quot;&lt;br /&gt;
* Click OK to close the dialog.&lt;br /&gt;
For your interest: &amp;quot;*.f;*.f77&amp;quot; are normally the default extensions for source code files, &amp;quot;*.cmn&amp;quot; is the extension for Fortran common-blocks and &amp;quot;*.inc&amp;quot; if often used as include file with e.g. variable declarations.&lt;br /&gt;
&lt;br /&gt;
== Setting up Fortran projects ==&lt;br /&gt;
To work with Fortran files, do the following:&lt;br /&gt;
Add a (new) file to the project, saved as &amp;quot;your_fortran_file.f&amp;quot;. Verify it's recognised as &amp;quot;Fortran Sources&amp;quot; file type. If not verify you have done the steps above correctly. To enable compiling the project which includes Fortran files follow these steps:&lt;br /&gt;
* Right click on the project, select &amp;quot;Build options&amp;quot; and make sure you have selected the &amp;quot;GNU G77 compiler&amp;quot; (see steps above).&lt;br /&gt;
* Right click on the &amp;quot;your_fortran_file.f&amp;quot; file and select &amp;quot;Properties&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
1.) Enable &amp;quot;Compile file&amp;quot; and &amp;quot;Link file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2.) Under the &amp;quot;Advanced&amp;quot; tab enter &amp;quot;CC&amp;quot; as compiler variable&lt;br /&gt;
&lt;br /&gt;
* Compile the project, it should work by now.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
For troubleshooting enable the &amp;quot;Full command line&amp;quot; Under menu &amp;quot;Settings&amp;quot; -&amp;gt; &amp;quot;Compiler&amp;quot; -&amp;gt; &amp;quot;Other&amp;quot; tab, &amp;quot;Compiler logging&amp;quot;. If you see that still the gcc compiler is invoked, make sure you setup the right compiler in the build options for your project '''AND''' your target (e.g. &amp;quot;default&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
== Using gfortran instead of g77 ==&lt;br /&gt;
The preceding steps can also be used to set up Code::Blocks to use the GNU gfortran Fortran '95 compiler, albeit with the following changes:&lt;br /&gt;
&lt;br /&gt;
* Setup the compiler as follows:&lt;br /&gt;
&lt;br /&gt;
1.) The &amp;quot;Compiler's installation directory&amp;quot; should point to the location of the root directory of the gfortran installation, for example if gfortran.exe is located in C:\gfortran\bin the path should read &amp;quot;C:\gfortran&amp;quot; (minus quotes).&lt;br /&gt;
&lt;br /&gt;
2.) Under the &amp;quot;Programs&amp;quot; tab, select &amp;quot;gfortran.exe&amp;quot; as both the C compiler and the linker for dynamic libs instead of &amp;quot;g77.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
3.) DO NOT add the linker commands as given previously; leave these fields blank.&lt;br /&gt;
&lt;br /&gt;
* Adding new Fortran file type&lt;br /&gt;
Procede as above, but add &amp;quot;*.f95&amp;quot; as a file type instead of &amp;quot;*.f77&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Follow the rest of the steps above and gfortran should work.&lt;/div&gt;</summary>
		<author><name>Brothernorth</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Fortran_support_in_Code::Blocks&amp;diff=2861</id>
		<title>Fortran support in Code::Blocks</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Fortran_support_in_Code::Blocks&amp;diff=2861"/>
		<updated>2006-04-27T00:15:19Z</updated>

		<summary type="html">&lt;p&gt;Brothernorth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Installation\Build Instructions]]&lt;br /&gt;
== Attaching the compiler framework ==&lt;br /&gt;
To attach the GNU Fortran 77 Compiler (G77) the following steps are required:&lt;br /&gt;
* Make a copy of the GNU GCC compiler as follows:&lt;br /&gt;
&lt;br /&gt;
1.) Goto menu &amp;quot;Settings&amp;quot; -&amp;gt; &amp;quot;Compiler&amp;quot;&lt;br /&gt;
&lt;br /&gt;
2.) Select the &amp;quot;GNU GCC Compiler&amp;quot;, click the &amp;quot;Copy Button&amp;quot;&lt;br /&gt;
&lt;br /&gt;
3.) Save the copy e.g. under &amp;quot;GNU G77 Compiler&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* Setup the compiler as follows:&lt;br /&gt;
&lt;br /&gt;
1.) The path etc. should be as of the GCC Compiler. If this has been setup correctly, no changes are required. Otherwise refer to the setup of the GNU GCC compiler.&lt;br /&gt;
&lt;br /&gt;
2.) Change under the &amp;quot;Programs&amp;quot; tab: &amp;quot;C compiler&amp;quot; =  &amp;quot;g77.exe&amp;quot;, &amp;quot;Linker for dynamic libs&amp;quot;: &amp;quot;g77.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
3.) In the &amp;quot;Linker&amp;quot; tab add &amp;quot;-lg2c&amp;quot; (and &amp;quot;-lstdc++&amp;quot; if you have mixed Fortran/C++ projects) under &amp;quot;Other linker options&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* Important: Make sure the path environment is setup to really point a path that contains the Fortran compiler suite. C::B with MinGW does '''NOT''' include the Fortran compiler. You may download the compiler under [http://www.mingw.org MinGW webpage]. &amp;quot;gcc-g77-3.4.2-20040916-1.tar.gz&amp;quot; is the name of the package I expect you want.&lt;br /&gt;
&lt;br /&gt;
== Adding new Fortran file type ==&lt;br /&gt;
It makes sense to add a new &amp;quot;Fortran Sources&amp;quot; filetype to have the Fortran source code files being seperated. Steps to do so:&lt;br /&gt;
* Goto menu &amp;quot;Project&amp;quot; -&amp;gt; &amp;quot;Project tree&amp;quot; -&amp;gt; &amp;quot;Edit file types categories&amp;quot;&lt;br /&gt;
* Click on &amp;quot;Add&amp;quot; to add a new type of files&lt;br /&gt;
* Select &amp;quot;Fortran Sources&amp;quot; as group name&lt;br /&gt;
* Enter the following in the file-mask (without quotation marks): &amp;quot;*.f;*.f77;*.cmn;*.inc;&amp;quot;&lt;br /&gt;
* Click OK to close the dialog.&lt;br /&gt;
For your interest: &amp;quot;*.f;*.f77&amp;quot; are normally the default extensions for source code files, &amp;quot;*.cmn&amp;quot; is the extension for Fortran common-blocks and &amp;quot;*.inc&amp;quot; if often used as include file with e.g. variable declarations.&lt;br /&gt;
&lt;br /&gt;
== Setting up Fortran projects ==&lt;br /&gt;
To work with Fortran files, do the following:&lt;br /&gt;
Add a (new) file to the project, saved as &amp;quot;your_fortran_file.f&amp;quot;. Verify it's recognised as &amp;quot;Fortran Sources&amp;quot; file type. If not verify you have done the steps above correctly. To enable compiling the project which includes Fortran files follow these steps:&lt;br /&gt;
* Right click on the project, select &amp;quot;Build options&amp;quot; and make sure you have selected the &amp;quot;GNU G77 compiler&amp;quot; (see steps above).&lt;br /&gt;
* Right click on the &amp;quot;your_fortran_file.f&amp;quot; file and select &amp;quot;Properties&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
1.) Enable &amp;quot;Compile file&amp;quot; and &amp;quot;Link file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2.) Under the &amp;quot;Advanced&amp;quot; tab enter &amp;quot;CC&amp;quot; as compiler variable&lt;br /&gt;
&lt;br /&gt;
* Compile the project, it should work by now.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
For troubleshooting enable the &amp;quot;Full command line&amp;quot; Under menu &amp;quot;Settings&amp;quot; -&amp;gt; &amp;quot;Compiler&amp;quot; -&amp;gt; &amp;quot;Other&amp;quot; tab, &amp;quot;Compiler logging&amp;quot;. If you see that still the gcc compiler is invoked, make sure you setup the right compiler in the build options for your project '''AND''' your target (e.g. &amp;quot;default&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
== Using gfortran instead of g77 ==&lt;br /&gt;
The preceding steps can also be used to set up Code::Blocks to use the GNU gfortran Fortran '95 compiler, albeit with the following changes:&lt;br /&gt;
&lt;br /&gt;
* Attaching The Compiler Framework&lt;br /&gt;
setup the compiler as follows:&lt;br /&gt;
&lt;br /&gt;
1.) The &amp;quot;Compiler's installation directory&amp;quot; should point to the location of the root directory of the gfortran installation, for example if gfortran.exe is located in C:\gfortran\bin the path should read &amp;quot;C:\gfortran&amp;quot; (minus quotes).&lt;br /&gt;
&lt;br /&gt;
2.) Under the &amp;quot;Programs&amp;quot; tab, select &amp;quot;gfortran.exe&amp;quot; as both the C compiler and the linker for dynamic libs instead of &amp;quot;g77.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
3.) DO NOT add the linker commands as given previously; leave these fields blank.&lt;br /&gt;
&lt;br /&gt;
* Adding new Fortran file type&lt;br /&gt;
Procede as above, but add &amp;quot;*.f95&amp;quot; as a file type instead of &amp;quot;*.f77&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Follow the rest of the steps above and gfortran should work.&lt;/div&gt;</summary>
		<author><name>Brothernorth</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Fortran_support_in_Code::Blocks&amp;diff=2860</id>
		<title>Fortran support in Code::Blocks</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Fortran_support_in_Code::Blocks&amp;diff=2860"/>
		<updated>2006-04-27T00:12:42Z</updated>

		<summary type="html">&lt;p&gt;Brothernorth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Installation\Build Instructions]]&lt;br /&gt;
== Attaching the compiler framework ==&lt;br /&gt;
To attach the GNU Fortran 77 Compiler (G77) the following steps are required:&lt;br /&gt;
* Make a copy of the GNU GCC compiler as follows:&lt;br /&gt;
&lt;br /&gt;
1.) Goto menu &amp;quot;Settings&amp;quot; -&amp;gt; &amp;quot;Compiler&amp;quot;&lt;br /&gt;
&lt;br /&gt;
2.) Select the &amp;quot;GNU GCC Compiler&amp;quot;, click the &amp;quot;Copy Button&amp;quot;&lt;br /&gt;
&lt;br /&gt;
3.) Save the copy e.g. under &amp;quot;GNU G77 Compiler&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* Setup the compiler as follows:&lt;br /&gt;
&lt;br /&gt;
1.) The path etc. should be as of the GCC Compiler. If this has been setup correctly, no changes are required. Otherwise refer to the setup of the GNU GCC compiler.&lt;br /&gt;
&lt;br /&gt;
2.) Change under the &amp;quot;Programs&amp;quot; tab: &amp;quot;C compiler&amp;quot; =  &amp;quot;g77.exe&amp;quot;, &amp;quot;Linker for dynamic libs&amp;quot;: &amp;quot;g77.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
3.) In the &amp;quot;Linker&amp;quot; tab add &amp;quot;-lg2c&amp;quot; (and &amp;quot;-lstdc++&amp;quot; if you have mixed Fortran/C++ projects) under &amp;quot;Other linker options&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* Important: Make sure the path environment is setup to really point a path that contains the Fortran compiler suite. C::B with MinGW does '''NOT''' include the Fortran compiler. You may download the compiler under [http://www.mingw.org MinGW webpage]. &amp;quot;gcc-g77-3.4.2-20040916-1.tar.gz&amp;quot; is the name of the package I expect you want.&lt;br /&gt;
&lt;br /&gt;
== Adding new Fortran file type ==&lt;br /&gt;
It makes sense to add a new &amp;quot;Fortran Sources&amp;quot; filetype to have the Fortran source code files being seperated. Steps to do so:&lt;br /&gt;
* Goto menu &amp;quot;Project&amp;quot; -&amp;gt; &amp;quot;Project tree&amp;quot; -&amp;gt; &amp;quot;Edit file types categories&amp;quot;&lt;br /&gt;
* Click on &amp;quot;Add&amp;quot; to add a new type of files&lt;br /&gt;
* Select &amp;quot;Fortran Sources&amp;quot; as group name&lt;br /&gt;
* Enter the following in the file-mask (without quotation marks): &amp;quot;*.f;*.f77;*.cmn;*.inc;&amp;quot;&lt;br /&gt;
* Click OK to close the dialog.&lt;br /&gt;
For your interest: &amp;quot;*.f;*.f77&amp;quot; are normally the default extensions for source code files, &amp;quot;*.cmn&amp;quot; is the extension for Fortran common-blocks and &amp;quot;*.inc&amp;quot; if often used as include file with e.g. variable declarations.&lt;br /&gt;
&lt;br /&gt;
== Setting up Fortran projects ==&lt;br /&gt;
To work with Fortran files, do the following:&lt;br /&gt;
Add a (new) file to the project, saved as &amp;quot;your_fortran_file.f&amp;quot;. Verify it's recognised as &amp;quot;Fortran Sources&amp;quot; file type. If not verify you have done the steps above correctly. To enable compiling the project which includes Fortran files follow these steps:&lt;br /&gt;
* Right click on the project, select &amp;quot;Build options&amp;quot; and make sure you have selected the &amp;quot;GNU G77 compiler&amp;quot; (see steps above).&lt;br /&gt;
* Right click on the &amp;quot;your_fortran_file.f&amp;quot; file and select &amp;quot;Properties&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
1.) Enable &amp;quot;Compile file&amp;quot; and &amp;quot;Link file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2.) Under the &amp;quot;Advanced&amp;quot; tab enter &amp;quot;CC&amp;quot; as compiler variable&lt;br /&gt;
&lt;br /&gt;
* Compile the project, it should work by now.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
For troubleshooting enable the &amp;quot;Full command line&amp;quot; Under menu &amp;quot;Settings&amp;quot; -&amp;gt; &amp;quot;Compiler&amp;quot; -&amp;gt; &amp;quot;Other&amp;quot; tab, &amp;quot;Compiler logging&amp;quot;. If you see that still the gcc compiler is invoked, make sure you setup the right compiler in the build options for your project '''AND''' your target (e.g. &amp;quot;default&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
== Using gfortran instead of g77 ==&lt;br /&gt;
The preceding steps can also be used to set up Code::Blocks to use the GNU gfortran Fortran '95 compiler, albeit with the following changes:&lt;br /&gt;
&lt;br /&gt;
* Attaching The Compiler Framework&lt;br /&gt;
Setting up the compiler&lt;br /&gt;
1.) The &amp;quot;Compiler's installation directory&amp;quot; should point to the location of the root directory of the gfortran installation, for example if gfortran.exe is located in C:\gfortran\bin the path should read &amp;quot;C:\gfortran&amp;quot; (minus quotes).&lt;br /&gt;
&lt;br /&gt;
2.) Under the &amp;quot;Programs&amp;quot; tab, select &amp;quot;gfortran.exe&amp;quot; as both the C compiler and the linker for dynamic libs instead of &amp;quot;g77.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
3.) DO NOT add the linker commands as given previously; leave these fields blank.&lt;br /&gt;
&lt;br /&gt;
* Adding new Fortran file type&lt;br /&gt;
Procede as above, but add &amp;quot;*.f95&amp;quot; as a file type instead of &amp;quot;*.f77&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Follow the rest of the steps above and gfortran should work.&lt;/div&gt;</summary>
		<author><name>Brothernorth</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Fortran_support_in_Code::Blocks&amp;diff=2859</id>
		<title>Fortran support in Code::Blocks</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Fortran_support_in_Code::Blocks&amp;diff=2859"/>
		<updated>2006-04-27T00:12:08Z</updated>

		<summary type="html">&lt;p&gt;Brothernorth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Installation\Build Instructions]]&lt;br /&gt;
== Attaching the compiler framework ==&lt;br /&gt;
To attach the GNU Fortran 77 Compiler (G77) the following steps are required:&lt;br /&gt;
* Make a copy of the GNU GCC compiler as follows:&lt;br /&gt;
&lt;br /&gt;
1.) Goto menu &amp;quot;Settings&amp;quot; -&amp;gt; &amp;quot;Compiler&amp;quot;&lt;br /&gt;
&lt;br /&gt;
2.) Select the &amp;quot;GNU GCC Compiler&amp;quot;, click the &amp;quot;Copy Button&amp;quot;&lt;br /&gt;
&lt;br /&gt;
3.) Save the copy e.g. under &amp;quot;GNU G77 Compiler&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* Setup the compiler as follows:&lt;br /&gt;
&lt;br /&gt;
1.) The path etc. should be as of the GCC Compiler. If this has been setup correctly, no changes are required. Otherwise refer to the setup of the GNU GCC compiler.&lt;br /&gt;
&lt;br /&gt;
2.) Change under the &amp;quot;Programs&amp;quot; tab: &amp;quot;C compiler&amp;quot; =  &amp;quot;g77.exe&amp;quot;, &amp;quot;Linker for dynamic libs&amp;quot;: &amp;quot;g77.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
3.) In the &amp;quot;Linker&amp;quot; tab add &amp;quot;-lg2c&amp;quot; (and &amp;quot;-lstdc++&amp;quot; if you have mixed Fortran/C++ projects) under &amp;quot;Other linker options&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* Important: Make sure the path environment is setup to really point a path that contains the Fortran compiler suite. C::B with MinGW does '''NOT''' include the Fortran compiler. You may download the compiler under [http://www.mingw.org MinGW webpage]. &amp;quot;gcc-g77-3.4.2-20040916-1.tar.gz&amp;quot; is the name of the package I expect you want.&lt;br /&gt;
&lt;br /&gt;
== Adding new Fortran file type ==&lt;br /&gt;
It makes sense to add a new &amp;quot;Fortran Sources&amp;quot; filetype to have the Fortran source code files being seperated. Steps to do so:&lt;br /&gt;
* Goto menu &amp;quot;Project&amp;quot; -&amp;gt; &amp;quot;Project tree&amp;quot; -&amp;gt; &amp;quot;Edit file types categories&amp;quot;&lt;br /&gt;
* Click on &amp;quot;Add&amp;quot; to add a new type of files&lt;br /&gt;
* Select &amp;quot;Fortran Sources&amp;quot; as group name&lt;br /&gt;
* Enter the following in the file-mask (without quotation marks): &amp;quot;*.f;*.f77;*.cmn;*.inc;&amp;quot;&lt;br /&gt;
* Click OK to close the dialog.&lt;br /&gt;
For your interest: &amp;quot;*.f;*.f77&amp;quot; are normally the default extensions for source code files, &amp;quot;*.cmn&amp;quot; is the extension for Fortran common-blocks and &amp;quot;*.inc&amp;quot; if often used as include file with e.g. variable declarations.&lt;br /&gt;
&lt;br /&gt;
== Setting up Fortran projects ==&lt;br /&gt;
To work with Fortran files, do the following:&lt;br /&gt;
Add a (new) file to the project, saved as &amp;quot;your_fortran_file.f&amp;quot;. Verify it's recognised as &amp;quot;Fortran Sources&amp;quot; file type. If not verify you have done the steps above correctly. To enable compiling the project which includes Fortran files follow these steps:&lt;br /&gt;
* Right click on the project, select &amp;quot;Build options&amp;quot; and make sure you have selected the &amp;quot;GNU G77 compiler&amp;quot; (see steps above).&lt;br /&gt;
* Right click on the &amp;quot;your_fortran_file.f&amp;quot; file and select &amp;quot;Properties&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
1.) Enable &amp;quot;Compile file&amp;quot; and &amp;quot;Link file&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2.) Under the &amp;quot;Advanced&amp;quot; tab enter &amp;quot;CC&amp;quot; as compiler variable&lt;br /&gt;
&lt;br /&gt;
* Compile the project, it should work by now.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
For troubleshooting enable the &amp;quot;Full command line&amp;quot; Under menu &amp;quot;Settings&amp;quot; -&amp;gt; &amp;quot;Compiler&amp;quot; -&amp;gt; &amp;quot;Other&amp;quot; tab, &amp;quot;Compiler logging&amp;quot;. If you see that still the gcc compiler is invoked, make sure you setup the right compiler in the build options for your project '''AND''' your target (e.g. &amp;quot;default&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
== Using gfortran instead of g77 ==&lt;br /&gt;
The preceding steps can also be used to set up Code::Blocks to use the GNU gfortran Fortran '95 compiler, albeit with the following changes:&lt;br /&gt;
&lt;br /&gt;
* Attaching The Compiler Framework&lt;br /&gt;
Setting up the compiler&lt;br /&gt;
1.) The &amp;quot;Compiler's installation directory&amp;quot; should point to the location of the root directory of the gfortran installation, for example if gfortran.exe is located in C:\gfortran\bin the path should read &amp;quot;C:\gfortran&amp;quot; (minus quotes).&lt;br /&gt;
&lt;br /&gt;
2.) Under the &amp;quot;Programs&amp;quot; tab, select &amp;quot;gfortran.exe&amp;quot; as both the C compiler and the linker for dynamic libs instead of &amp;quot;g77.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
3.) DO NOT add the linker commands as given previously; leave these fields blank.&lt;br /&gt;
&lt;br /&gt;
== Adding new Fortran file type ==&lt;br /&gt;
Procede as above, but add &amp;quot;*.f95&amp;quot; as a file type instead of &amp;quot;*.f77&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Follow the rest of the steps above and gfortran should work.&lt;/div&gt;</summary>
		<author><name>Brothernorth</name></author>
	</entry>
</feed>