Code::Blocks Forums

User forums => Help => Topic started by: karaul on June 12, 2018, 04:01:28 pm

Title: fortran open statement crash
Post by: karaul on June 12, 2018, 04:01:28 pm
I downloaded and started new fortran application in CB 17.12 and put this simple code into main.f95

program main
    integer i
    OPEN (3,file='test.dat')
    READ (3,*) i
    CLOSE (3)
    write(*,*) ' i=',i
end

Then, successfully compilied and builded with gfortran as compiler, and it crashes with

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

 C:\Program Files (x86)\CodeBlocks\MinGW\bin> .\gfortran.exe --version

GNU Fortran (tdm-1) 5.1.0
Copyright (C) 2015 Free Software Foundation, Inc.

GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING
Title: Re: fortran open statement crash
Post by: Miguel Gimenez on June 12, 2018, 04:11:18 pm
See this thread, updated yesterday:

http://forums.codeblocks.org/index.php/topic,22683.0.html (http://forums.codeblocks.org/index.php/topic,22683.0.html)
Title: Re: fortran open statement crash
Post by: karaul on June 12, 2018, 05:17:07 pm
Thank you for the quick answer. Unfortunately, the suggested fix to replace "libgfortran-3.dll" does not work.

So, I need to change fortran compiler. I do not know how to do it yet, but it is hopefully described in the manual. 

PS: I used mingw from here https://sourceforge.net/projects/mingw/files/MinGW/Base/gcc/Version6/
With this replaced compiler, it works now.