I encounter the problem like this:
ld: /mnt/c/FYP/adcirc_v55.01/work/odir44/swanmain.o: in function `MAIN__':
swanmain.f:(.text+0x0): multiple definition of `MAIN__'; /mnt/c/FYP/adcirc_v55.01/work/odir44/driver.o:driver.F:(.text+0x0): first defined here
make[1]: *** [makefile:605: padcswan] Error 1
make[1]: Leaving directory '/mnt/c/FYP/adcirc_v55.01/work'
make: *** [makefile:517: padcswan] Error 2
what should i do
链接已复制
A program can only have one MAIN program unit. In Fortran that is the program unit. Apparently your link statement includes two or more object files that are derived from a source file containing "program somename"'. You will have to check which one is the correct one. (Or perhaps one should be a subroutine)
The error messages from the linker make it quite clear that both swanmain.o and driver.o contain main program units. Only one of the two should be used. Which one? That is for you to determine, based on what the files contain and what you are attempting to build.
