gfortran中对'sleep'和'sizeof'instrinsic的未定义引用
gfortran找不到GNU Fortran提供的内在函数(sleep、sizeof等): 我已经从MinGW安装管理器安装了mingw32 base和mingw32 gcc fortran 即使使用以下简单代码,也会出现此问题:gfortran中对'sleep'和'sizeof'instrinsic的未定义引用,fortran,mingw,gfortran,Fortran,Mingw,Gfortran,gfortran找不到GNU Fortran提供的内在函数(sleep、sizeof等): 我已经从MinGW安装管理器安装了mingw32 base和mingw32 gcc fortran 即使使用以下简单代码,也会出现此问题: program p implicit none call SLEEP(1) end program p 命令:$gfortran.exe-std=f2008。\test.f08 事实上,它与$gfortran.exe。\test.f08一起工作。但是,它
program p
implicit none
call SLEEP(1)
end program p
命令:$gfortran.exe-std=f2008。\test.f08
事实上,它与
$gfortran.exe。\test.f08
一起工作。但是,它应该与前一个程序一起使用。您使用的程序不是标准Fortran。当您通过-std=f2008
明确请求标准Fortran时,编译器不会链接非标准的内部过程,因为它们不在您明确请求的标准中
当你使用
intrinsic sleep
您会得到一条更明确的错误消息:
intrinsic sleep
1
Error: The intrinsic ‘sleep’ declared INTRINSIC at (1) is not available
in the current standard settings but a GNU Fortran extension. Use an appropriate
‘-std=*’ option or enable ‘-fall-intrinsics’ in order to use it.
因此,正如消息所说,您可以使用
-fall intrinsics
启用非标准的内部过程。您使用的过程不是标准的Fortran。当您通过-std=f2008
明确请求标准Fortran时,编译器不会链接非标准的内部过程,因为它们不在您明确请求的标准中
当你使用
intrinsic sleep
您会得到一条更明确的错误消息:
intrinsic sleep
1
Error: The intrinsic ‘sleep’ declared INTRINSIC at (1) is not available
in the current standard settings but a GNU Fortran extension. Use an appropriate
‘-std=*’ option or enable ‘-fall-intrinsics’ in order to use it.
因此,正如消息所说,您可以使用
-fall intrinsics
来启用非标准的内部过程。请显示您的代码(理想情况下只有两行调用sleep(1);end
)、编译命令和包含错误的完整输出。请确保其中没有外部睡眠
。请显示您的代码(理想情况下,只有两行调用sleep(1);end
)、编译命令和包含错误的完整输出。确保其中没有外部睡眠。