我有一些.h文件用於FORTRAN 77中的某些模塊(我沒有自己寫過)。我想在Fortran 90中編寫一個新例程並使用這樣的.h文件。 我試着使用include 'foo.h'
,當我嘗試編譯(使用ifort版本13.0.0.079構建20120731)我得到以下錯誤:如何在Fortran 90中使用include語句?
Syntax error, found IDENTIFIER 'FOO' when expecting one of: (% [ : . = => C FOO COMMOM
我也嘗試過使用include foo.h
,怎麼辦我以下錯誤: error #5082: Syntax error, found IDENTIFIER 'FOO' when expecting one of: <CHAR_CON_KIND_PARAM> <CHAR_NAM_KIND_PARAM> <CHARACTER_CONSTANT> INCLUDE FOO.h ----------^
error #6274: This statement must not appear in the specification part of a module INCLUDE foo.h --^
error #6236: A specification statement cannot appear in the executable section. !$ use omp_lib ---^
error #6236: A specification statement cannot appear in the executable section. implicit none --^
error #6456: This name must be a RECORD name. [FOO] INCLUDE FOO.h ----------^
error #6460: This is not a field name that is defined in the encompassing structure. [H] INCLUDE foo.h
-----------------^
error #6252: This format specifier is invalid. [FOO] INCLUDE foo.h
我猜include
不存在F90 。有沒有類似的,允許使用.h文件?
你試過'include'foo.h''嗎? – milancurcic 2013-03-18 14:33:14
是的,我已經嘗試了包括'foo.h'和'包括foo.h' – ziulfer 2013-03-18 14:46:25
他們都給你同樣的錯誤?在您的問題中包含編譯器錯誤消息時,包含編譯器名稱和版本總是有用的。 – milancurcic 2013-03-18 14:51:54