no input files when calling gfortran

Tom Kacvinsky tkacvins@gmail.com
Sun Jan 1 15:48:06 GMT 2023


On Sun, Jan 1, 2023 at 10:34 AM Hans Lonsdale via Gcc-help <
gcc-help@gcc.gnu.org> wrote:

>
>
> January 1, 2023 at 2:31:28 PM CET Jonathan Wakely <jwakely.gcc@gmail.com>
> wrote:
>
> On Sun, 1 Jan 2023, 11:43 Hans Lonsdale via Gcc-help, <
> gcc-help@gcc.gnu.org> wrote:
>
> Am trying to compile a free-format fortran file with some subroutines in
> it, with gfortran complaining
> about the file.  What is going on?
>
> gfortran -O3 -ffree-form -o kamkrai-sort.f
> gfortran: fatal error: no input files; unwilling to write output files
> compilation terminated.
>
> The -o option names the output file, but you have told the compiler to use
> your input file as the output file.
>
> What is the appropriate command that generates the object file only ?
>

gfortran -O3 -ffree-form -c kamkrai-sort.f

Or if you want to name the object file differently,

gfortran -O3 -ffree-form -c  kamkrai-sort.f -o some_other_name.o


More information about the Gcc-help mailing list