简体   繁体   English

使用eclipse编译Fortran代码时出错...通过Linux终端使用Gfortran时可以

[英]Error compiling Fortran code with eclipse… it is OK when using Gfortran via Linux terminal

I am trying to compile a .f Fortran code with Eclipse. 我正在尝试使用Eclipse编译.f Fortran代码。 I have tried both of the below methods from the Eclipse help site: 我已经从Eclipse帮助站点尝试了以下两种方法:

  1. Starting a Project with an Auto-Generated Makefile 使用自动生成的Makefile启动项目
  2. Starting a Project with a Hand-Written Makefile 使用手写的Makefile启动项目

However, Eclipse gives multiple different errors... Here are some of the errors: 但是,Eclipse提供了多个不同的错误......以下是一些错误:

   DIMENSION DDDJ(0:IG,-1:JG)                                          
     1
Error: Non-numeric character in statement label at (1)
../Main1.f:16.5:

    DIMENSION DDDJ(0:IG,-1:JG)                                          
     1
Error: Unclassifiable statement at (1)
../Main1.f:19.5:

    DIMENSION MSN(1:NPP)  ! S(x,t)                                      
     1
Error: Non-numeric character in statement label at (1)
Fatal Error: Error count reached limit of 25.
make: *** [Main1.o] Error 1

14:51:55 Build Finished (took 1s.244ms)

I have compiled the code in the terminal using Gfortran simply and i have obtained the executable file an obtained the results. 我已经使用Gfortran在终端中编译了代码,我已经获得了可执行文件并获得了结果。 But Eclipse did not work for me at all. 但是Eclipse根本不适合我。

I want to debug my code. 我想调试我的代码。 it is 1236 raws. 它是1236原料。 Can someone help me with Eclipse or any other suggestion? 有人可以帮我解决Eclipse或任何其他建议吗?

I solved the issue. 我解决了这个问题。

It is related with the form of Fortran file. 它与Fortran文件的形式有关。 I was copying the code into a new Fortran source file. 我正在将代码复制到新的Fortran源文件中。 I decided to import the file that I have into the project. 我决定将我拥有的文件导入到项目中。

This solved my issue. 这解决了我的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM