User forums > Help

fortran open statement crash


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

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

Miguel Gimenez:
See this thread, updated yesterday:,22683.0.html

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
With this replaced compiler, it works now.


[0] Message Index

Go to full version