- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
I try to build the Fortran code containing several fortran files with modules. I run it like this :
ifort -c constant.f90 CommonSub.f90 typedef.f90 globals.f90 output.f90 Prepro.f90 mesh3d.f90 ccfluids.f90 RMHD3D.f90
ifort -o MHD constant.o CommonSub.o typedef.o globals.o output.o Prepro.o mesh3d.o ccfluids.o RMHD3D.o
It open the following error:
ld: can't link with a main executable file 'constant.o' for architecture x86_64
How can I fix this problem ??
PS:
The version of Intel Fortran compiler on Mac machine :
$ ifort -V
Intel(R) Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 19.0.0.117 Build 20180804
Copyright (C) 1985-2018 Intel Corporation. All rights reserved.
링크가 복사됨
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
A bit of Googling suggests that constant.o is already linked as an executable file. How sure are you that you used -c on the first line?
