英特尔 Visual Fortran 编译错误
当我编译项目时,Intel Visual Fortran 不断给出此类错误。错误出现在下面的代码中:
dimension tairgl(12),eairgl(24),windgl(12),psisgl(12),yenang(98),yunazm(98)
这是编译器给出的错误信息。
Error: Syntax error, found END-OF-STATEMENT when expecting one of: ( [
有人对这个错误有任何想法吗?
When I compile a project, Intel Visual Fortran keeps giving me this kind of error. The error is found on the code below:
dimension tairgl(12),eairgl(24),windgl(12),psisgl(12),yenang(98),yunazm(98)
This is the error message given by the compiler.
Error: Syntax error, found END-OF-STATEMENT when expecting one of: ( [
Anybody have any idea about this error?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
语法看起来没问题。我可以想到两种可能性:1)编译器配置为仅查看第 72 列的源代码,并且该行较长,2)错误在其他地方并且消息具有误导性。可能性 1 假设您正在编译具有固定格式源布局的 Fortran 77,而不是 Fortran 90,或者编译器针对 Fortran 90 配置错误。要修复可能性 1,可以使用延续来分割该行,将其分割为二维语句,或者找到导致编译器接受更长行的编译器选项
The syntax looks OK. I can think of two possibilities: 1) the compiler is configured to only look at source code to column 72 and this line is longer, 2) the error is somewhere else and the message is misleading. Possibility 1 assumes that you are compiling Fortran 77 with its fixed-form source layout, rather than Fortran 90, or that the compiler is mis-configured for Fortran 90. To fix possibility 1, either split the line with a continuation, split it into two dimension statements, or find the compiler option that causes the compiler to accept longer lines
从问题来看,维度语句后似乎有一个换行符。是这样吗?如果这给出了意外的 END-OF-STATEMENT 错误,我不会感到惊讶。
From the question, it looks like there's a newline after the dimension statement. Is that right? I wouldn't be surprised if that gave an unexpected END-OF-STATEMENT error.