我試圖使用ifort編譯.f文件。聲明標籤字段中的非法字符 - 編譯.f擴展名時
我得到了以下錯誤:
/.../wreqvr.f(2):錯誤#5149:在聲明標籤領域[H] 此文件是GNU C庫的一部分非法字符。 ----^
從以下建議: https://software.intel.com/en-us/forums/intel-visual-fortran-compiler-for-windows/topic/293662 - >說,更改擴展名.F到.F90的作品。
有沒有其他解決方案? (我不想更改擴展名,因爲代碼是由Git管理的...)
我對舊機器使用了相同的ifort版本,該版本沒有錯誤地正常工作。
我不明白爲什麼會出現這個錯誤。
我的舊機和新機之間的唯一區別是CentOS的版本(老6,新7)
是否gcc版本此事有關這個錯誤?
我添加了部分代碼和錯誤消息。在這裏:coord.f文件
$ ifort coord.f
coord.f(1): error #5149: Illegal character in statement label field [/]
/* Copyright (C) 1991-2012 Free Software Foundation, Inc.
^
coord.f(1): error #5149: Illegal character in statement label field [*]
/* Copyright (C) 1991-2012 Free Software Foundation, Inc.
-^
coord.f(1): error #5149: Illegal character in statement label field [C]
/* Copyright (C) 1991-2012 Free Software Foundation, Inc.
---^
coord.f(1): error #5149: Illegal character in statement label field [o]
/* Copyright (C) 1991-2012 Free Software Foundation, Inc.
----^
coord.f(1): error #5118: First statement in file must not be continued
/* Copyright (C) 1991-2012 Free Software Foundation, Inc.
-----^
coord.f(2): error #5149: Illegal character in statement label field [T]
This file is part of the GNU C Library.
---^
coord.f(2): error #5149: Illegal character in statement label field [h]
This file is part of the GNU C Library.
----^
coord.f(4): error #5149: Illegal character in statement label field [T]
The GNU C Library is free software; you can redistribute it and/or
---^
coord.f(4): error #5149: Illegal character in statement label field [h]
The GNU C Library is free software; you can redistribute it and/or
$ ifort - 免費coord.f 或 $ ifort coord.f90
coord.f(1): error #5082: Syntax error, found '/' when expecting one of: <LABEL> <END-OF-STATEMENT> ; BLOCK BLOCKDATA PROGRAM MODULE TYPE BYTE CHARACTER ...
/* Copyright (C) 1991-2012 Free Software Foundation, Inc.
^
coord.f(16): error #5145: Invalid blank/tab
<http://www.gnu.org/licenses/>. */
----------------------------------^
coord.f(20): error #5145: Invalid blank/tab
include it implicitly at the start of every compilation. It must
-----------------------------------------------------------^
coord.f(29): error #5143: Missing mandatory separating blank
/* wchar_t uses ISO/IEC 10646 (2nd ed., published 2011-03-15)/
--------------------------------^
coord.f(30): error #5145: Invalid blank/tab
Unicode 6.0. */
---------------^
你是否確認改變擴展名是否有效?代碼在哪裏?參見[mcve]和[問]。 –
In Intol Fortran使用'-free'來強制固定的源代碼格式(.f90之一)。 –
*「海灣合作委員會版本是否有關這個錯誤的問題?」*這與GCC無關...... –