Using chmod fails under MinGW

Arjen Markus arjen.markus@wldelft.nl
Thu Oct 2 13:34:00 GMT 2008


Hello,

I am experimenting with the GNU extensions for gfortran
under Windows (MinGW, gfortran 4.3.2-tdm-1 to be more precise)
to see how these functions and subroutines behave. I ran into
the following problem with chmod:

C:\DOCUME~1\HP_EIG~1\LOCALS~1\TempccONaqaG.o:chk_windows.f90:(.text+0x200):
undefined reference to `__gfortran_chmod_i4_sub'
collect2: ld returned 1 exit status

Apparently the chmod subroutine is recognised as an intrinsic,
but there is no suitable implementation.

Here is the relevant source code:

  call chmod( 'chk.dat', 'u+r', status )
  write(*,*) 'Changing status: ', merge('success', 'failure', status == 0 )

Using the function form gives a similar error message, this time
on __gfortran_chmod_func

Regards,

Arjen



More information about the Fortran mailing list