我想在Windows下編譯Fortran 90(固定格式)庫。但是,我無法理解前置變量的錯誤。如何在使用英特爾Visual Fortran時使用預處理變量
Say the sample file is VF_TestPreprocessor.F:
program VF_TestPreprocessor
implicit Integer(A-Z)
Parameter (TestAlpha=22,TestBeta=TestGamma)
print *, TestBeta
end program VF_TestPreprocessor
在Linux下,我可以使用ifort VF_TestPreprocessor.F -DTestGamma=25
進行編譯和運行。
但是,在windows下,我不能用ifort VF_TestPreprocessor.F /DTestGamma=25
來編譯。錯誤消息是error #6592: This symbol must be a defined parameter, an enumerator, or an argument of an inquiry function that evaluates to a compile-time constant. [TestGamma]
。你能幫助分析錯誤嗎?
非常感謝您的建議!但是,這兩種解決方案都不起作用。運行「./ifort.exe VF_TestPreprocessor.F/DDEFMAXXCNAME = 25/fpp」的錯誤消息是「link:unknown option - s」,表示編譯部分成功。 (另一個線索是「./ifort.exe VF_TestPreprocessor.F/DDEFMAXXCNAME = 25/fpp/c」成功。)您能否幫助評論有關新的錯誤消息? – SOUser
「link:unknown option - s」的錯誤消息實際上是我的另一個錯誤。 http://software.intel.com/en-us/forums/showthread.php?t=81388&o=d&s=lr – SOUser