尝试编译时出现如下所示的大量错误:
user@DESKTOP-57BGLNH:~$ pwd
/home/user
user@DESKTOP-57BGLNH:~$ ls
COBOL testdoc.cob
user@DESKTOP-57BGLNH:~$ cobc -x testdoc.cob
assignment1.cob:1: error: invalid indicator 'f' at column 7
assignment1.cob:2: error: invalid indicator 'm' at column 7
assignment1.cob:4: error: invalid indicator 'n' at column 7
assignment1.cob:5: error: invalid indicator 'u' at column 7
assignment1.cob:7: error: invalid indicator 'i' at column 7
assignment1.cob:8: error: invalid indicator 'g' at column 7
assignment1.cob:10: error: invalid indicator 'u' at column 7
assignment1.cob:11: error: invalid indicator 'a' at column 7
assignment1.cob:12: error: invalid indicator 'k' at column 7
assignment1.cob:14: warning: line not terminated by a newline [-Wothers]
assignment1.cob:14: error: invalid indicator 'r' at column 7
assignment1.cob:9: error: PROGRAM-ID header missing
assignment1.cob:9: error: PROCEDURE DIVISION header missing
assignment1.cob:9: error: syntax error, unexpected PICTURE
user@DESKTOP-57BGLNH:~$
*对于上下文,
我在 VSC 中,我打开远程窗口并使用以下代码创建一个新文件:
identification division.
program-id. Assignment1.
environment division.
configuration section.
data division.
working-storage section.
01 out pic x(11) value "Hello World".
procedure division.
display out.
goback.
end program Assignment1.
File> Save.
打开新终端,并使用 pwd 和 ls 确保我在正确的目录中,如您所见,“/home/user”是文件“testdoc.cob”所在的目录,按照 ls 命令。然后我使用“cobc -x testdoc.cob”编译,然后我得到了这些系列的错误。为什么是这样?我哪里错了?
我试过在具有不同扩展名的新文件夹中重复该过程,结果都是一样的。