0

i want to execute two fortran file x.f and y.f attached in the link

for this i did

gfortran -o x x.f

gfortran -o y y.f

However in both the cases i am getting error

/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/Scrt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status

Additionally, i searched over the internet for its solution, but i am not getting proper answer.I hope experts may help me executing these fortran codes.

manas
  • 479
  • 2
  • 14
  • The compiler seems to be telling you that neither source file represents a complete program, nor do the two together do so. – John Bollinger Jul 26 '21 at 15:06
  • 1
    I have not reviewed the sources, and I will not review them from an external site. If you want us to evaluate code, then edit the question to include a [mre], directly in the question. Otherwise, there's not much else we can say. – John Bollinger Jul 26 '21 at 15:12
  • You should not paste the full code. Read the description of a MRE to which I already linked. Choose one of the files, and prepare an MRE from it. This will require some work on your part. – John Bollinger Jul 26 '21 at 15:17
  • But my best guess without seeing any code is that the sources you are looking at provide only functions and subroutines, possibly in modules, and not any main program. – John Bollinger Jul 26 '21 at 15:19
  • The real file name of "x.f, y.f" is `gnssSNR.f` as line one says. Full context https://github.com/kristinemlarson/gnssSNR → `$ make` : No errors. – Knud Larsen Jul 26 '21 at 15:21
  • Yes. You cannot plug out a file connected to ~11 other files. Must be compiled with the makefile. `cd gnssSNR/ && make` ( After getting the package with : `git clone https://github.com/kristinemlarson/gnssSNR.git` ) – Knud Larsen Jul 26 '21 at 15:28
  • Well, change to a new folder, and clone the files again with git. ......... You cannot say "no makefile", when it is visible and can be read / downloaded https://github.com/kristinemlarson/gnssSNR – Knud Larsen Jul 26 '21 at 15:31
  • I read the file name as `gnssSNR.f` : https://github.com/kristinemlarson/gnssSNR – Knud Larsen Jul 26 '21 at 15:36

0 Answers0