Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: dimitris on February 03, 2017, 05:37:00 pm

Title: fortran codeblocks
Post by: dimitris on February 03, 2017, 05:37:00 pm
I am new here and I don't know if it is the propper place for asking this type of questions.
I use Code::Blocks as IDE for C++. Everything works fine.
But I can' t figure out what is the relevant procedure for creating a Fortran program.
I have downloaded this version of Code:Blocks codeblocks-16.01mingw-setup.exe
Should I download CBFotran?
When I ask the program to create a Fortran application the following minimal file is created
Code
 A fortran95 program for G95 
! By WQY
program main
  implicit none
  integer re_i
  write(*,*) "Hello World!"
  re_i = system("pause")
end

But the program cannot compile it.
Should I download indepentantly a compiler?
Title: Re: fortran codeblocks
Post by: stahta01 on February 03, 2017, 06:35:25 pm
Code::Blocks is just an IDE; so, yes, you need to download an Compiler!

Note: The CB Installer with mingw in it's filename does have an C++/C Compiler; no idea if it has a FORTRAN compiler.

Tim S.
Title: Re: fortran codeblocks
Post by: dimitris on February 03, 2017, 06:44:15 pm
Thanks a lot for your the quick reponse.
How I can detect if there is already a compiler?
If there is not and supposing I have downloaded one like gfortran how can I guide Code:Blocks to detect the compiler?
Title: Re: fortran codeblocks
Post by: stahta01 on February 03, 2017, 06:48:02 pm
Under the CB Installation folder there is a mingw folder look at the exe files in [the bin sub-folder]; does one have fortran in its name or not.

Tim S.
Title: Re: fortran codeblocks
Post by: stahta01 on February 03, 2017, 06:57:55 pm
Just looked at the CB Downloads; I would guess the only one with an FORTRAN compiler is the one with fortran in its filename.
https://sourceforge.net/projects/codeblocks/files/Binaries/16.01/Windows/codeblocks-16.01mingw_fortran-setup.exe/download (https://sourceforge.net/projects/codeblocks/files/Binaries/16.01/Windows/codeblocks-16.01mingw_fortran-setup.exe/download)

Tim S.
Title: Re: fortran codeblocks
Post by: dimitris on February 03, 2017, 08:33:25 pm
Thank you very much for the useful replies.
I hope that I will not face a problem.
Title: Re: fortran codeblocks
Post by: dimitris on February 03, 2017, 09:58:48 pm
No, there is not a Fortran Compiler in
...\CodeBlocks\MinGW\bin
I guess I have to install one there.
In fact I followed the procedure described here
https://doc-14-7o-docs.googleusercontent.com/docs/securesc/ha0ro937gcuc7l7deffksulhg5h7mbp1/gl5vs6g6j5s5liu79nkbqjgnqhfblntt/1486152000000/02552863230247067214/*/1n5a91xiRR-LDm1xFC0MgCWn3QJ8sYHX0bz1GZ7cZo_BuYOxNYESpQfoIz8N9 (https://doc-14-7o-docs.googleusercontent.com/docs/securesc/ha0ro937gcuc7l7deffksulhg5h7mbp1/gl5vs6g6j5s5liu79nkbqjgnqhfblntt/1486152000000/02552863230247067214/*/1n5a91xiRR-LDm1xFC0MgCWn3QJ8sYHX0bz1GZ7cZo_BuYOxNYESpQfoIz8N9)
Everything works fine.
Title: Re: fortran codeblocks
Post by: Kousha on March 12, 2017, 12:59:43 pm
Read the instructions in this link:
http://gdurl.com/s20W

Then, download the file at this address and install it:
http://users.humboldt.edu/finneyb/gfortran-windows-20140629.exe

I hope this helps
Kousha