“无效的符号声明或引用......”错误

时间:2015-03-14 06:57:44

标签: fortran fortran77 g77

我想在ubuntu 32位机器上编译包含以下命令的makefile。

g77 -Wall -c -x f77-cpp-input -Wall

但是我遇到了一些我无法解决的问题。

[gustep.f][1] : In subroutine `gustep':
gustep.f:21: 
           INCLUDE 'gcblocks.inc'
           ^
Unable to open INCLUDE file `[gcblocks.inc][2]' at (^)
gustep.f:122: 
           CUTNEU = 1.0e-8
           ^
Invalid declaration of or reference to symbol `cutneu' at (^) [initially seen at (^)]
gustep.f:123: 
           IHADR = 5
           ^
Invalid declaration of or reference to symbol `ihadr' at (^) [initially seen at (^)]
gustep.f:125: 
           IF(NGKINE.GT.0) CALL GSKING(0)
              ^
Invalid declaration of or reference to symbol `ngkine' at (^) [initially seen at (^)]
gustep.f:129: 
                 IF(GKIN(5,I).EQ.13) THEN
                    ^
Invalid declaration of or reference to symbol `gkin' at (^) [initially seen at (^)]
gustep.f:140: 
           IF(INWVOL.EQ.1) THEN
              ^
Invalid declaration of or reference to symbol `inwvol' at (^) [initially seen at (^)]
gustep.f:141: 
               CALL GMEDIA(VECT,NUMED)
                           ^
Invalid declaration of or reference to symbol `vect' at (^) [initially seen at (^)]
gustep.f:141: 
               CALL GMEDIA(VECT,NUMED)
                                ^
Invalid declaration of or reference to symbol `numed' at (^) [initially seen at (^)]
gustep.f:144: 
           CALL UHTOC(NAMES(NLEVEL),4,NAME,4)
                      ^
Invalid declaration of or reference to symbol `names' at (^) [initially seen at (^)]
gustep.f:144: 
           CALL UHTOC(NAMES(NLEVEL),4,NAME,4)
                            ^
Invalid declaration of or reference to symbol `nlevel' at (^) [initially seen at (^)]
gustep.f:152: 
           IF(ITRA.EQ.TRAK_P) THEN
              ^
Invalid declaration of or reference to symbol `itra' at (^) [initially seen at (^)]
gustep.f:173: 
                COPY_NO      = NUMBER(NLEVEL-2)
                               ^
Invalid declaration of or reference to symbol `number' at (^) [initially seen at (^)]
gustep.f:177: 
                DE_P_DEL(M)  = DE_P_DEL(M)+DESTEP*1000.
                                           ^
Invalid declaration of or reference to symbol `destep' at (^) [initially seen at (^)]
In file included from gustep.f:0:

为什么这个声明无效?以及如何解决问题?可以 有人解释一下吗?

1 个答案:

答案 0 :(得分:1)

这正是编译器告诉你的:

Unable to open INCLUDE file `[gcblocks.inc][2]'

找不到文件gcblocks.inc。其他错误是关于缺少变量声明。可能这些是在丢失的文件中声明的。当前目录中是gcblocks.inc吗?如果没有,您需要使用-I/path/to/include/dir/指定其目录。