News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

fortran codeblocks

Started by dimitris, February 03, 2017, 05:37:00 PM

Previous topic - Next topic

dimitris

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

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?

stahta01

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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

dimitris

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?

stahta01

#3
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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

stahta01

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

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

dimitris

Thank you very much for the useful replies.
I hope that I will not face a problem.

dimitris


Kousha

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