Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/fortran/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Fortran 对`rindex'的未定义引用_`_Fortran_Fortran77 - Fatal编程技术网

Fortran 对`rindex'的未定义引用_`

Fortran 对`rindex'的未定义引用_`,fortran,fortran77,Fortran,Fortran77,我有一个Fortran 77(*.f)的代码。我使用编译器fort77,但它给我以下错误: geodv.o: In function `main__ ': fort77-10104-1.c: (. text +0 x287): reference to `rindex_ 'undefined collect2: error: ld returned 1 exit status 代码可以找到。感谢您的帮助您已在第15行中将rindex声明为integer*4,但将其用作第62行

我有一个Fortran 77(*.f)的代码。我使用编译器fort77,但它给我以下错误:

   geodv.o: In function `main__ ':
   fort77-10104-1.c: (. text +0 x287): reference to `rindex_ 'undefined
   collect2: error: ld returned 1 exit status

代码可以找到。感谢您的帮助

您已在第15行中将
rindex
声明为
integer*4
,但将其用作第62行中的
nd2=rindex(entete,'/')
。Fortran希望第62行表示,
rindex
是一个函数,而不是一个整数。

试试这个:

        nd1 = index(entete,'/')
    nd2 = index(entete(nd1+1:),'/')+nd1

注意,这将给出第二个“/”的位置,而不是最后一个,因此只有当字符串只有两个“/”时,它才是相同的。

您好,有一个问题?我如何进行更改以确定哪一个是函数?非常感谢。如果
rindex
应该是一个函数,您需要在代码中定义该函数,就像您在
ichy
(第494行)和
今天的
(第454行)中所做的那样。代码中有一个错误,因为我的老师错误地键入了代码。rindex=index但在a.out中显示一个错误:列表输入:文件结束明显状态:内部I/O直接读取最近格式化的内部IO中止您认为呢?从代码来看,他不太可能打算用相同的参数在一行中调用索引两次。rindex是一些编译器支持的扩展。(显然编写代码的人都可以使用)。您可以使用index()Hello在大约10行中编写自己的代码。我尝试了改变,我得到了a,发出了命令a、 输出后,我发现以下内容:列表输入:文件结束明显状态:内部I/O直接读取最近格式化的内部IO中止我猜您的字符串没有按预期保存日期。将write(*,*)nd1、nd2、entete放在上述行之后。