1 (edited by tedbrogan 2015-06-30 18:22:02)

Topic: Linker Input Error

I've seen similar problems reported, but I can't figure this one out. I am compiling an old f77 source code that works fine in Linux (I am trying to generate a Windows executable now). The compiler does not like my include files. I know I am missing a flag somewhere, but I don't know what or where.

Here is the top of the Makefile

#
# Automagically generated by Approximatrix Simply Fortran 2.24
#
FC="C:\Program Files (x86)\Simply Fortran 2\mingw-w64\bin\gfortran.exe"
CC="C:\Program Files (x86)\Simply Fortran 2\mingw-w64\bin\gcc.exe"
AR="C:\Program Files (x86)\Simply Fortran 2\mingw-w64\bin\ar.exe"
WRC="C:\PROGRA~2\SIMPLY~1\MINGW-~1\bin\windres.exe"
RM=rm -f

IDIR=
# -I error: Directory C:\Users\tbrogan\AppData\Local\\sfpm\64\include does not exist

LDIR=
# -L error: Directory C:\Users\tbrogan\AppData\Local\\sfpm\64\lib does not exist


OPTFLAGS= -g

SPECIALFLAGS=$(IDIR)

RCFLAGS=-O coff

PRJ_FFLAGS=

PRJ_CFLAGS=

PRJ_LFLAGS=

FFLAGS=$(SPECIALFLAGS) $(OPTFLAGS) $(PRJ_FFLAGS) -Jmodules

CFLAGS=$(SPECIALFLAGS) $(OPTFLAGS) $(PRJ_CFLAGS)

"build\bccut.o": ".\bccut.f"
    @echo Compiling .\bccut.f
    @$(FC) -c -o "build\bccut.o" $(FFLAGS) ".\bccut.f"




Here is the output

==============================================================================
Generating Makefile... Okay
==============================================================================
Compiling .\bccut.f
Compiling .\bcfarf.f
Compiling .\bcinflo.f
Compiling .\bcond.f
Compiling .\bcoutflo.f
Compiling .\bcsymm.f
Compiling .\bcwall.f
Compiling .\control.inc
gfortran.exe: warning: .\control.inc: linker input file unused because linking not done
Error(F38): (build\control.o) does not exist and cannot be made from existing files
Error(E02): Make execution terminated

Re: Linker Input Error

For some reason, Simply Fortran is attempting to separately compile your include file, which is incorrect.  It's a bug.  For now what you can do is right-click the file "control.inc" (and any other include files you might have) in the Project Outline, right-click, and select "Disable File..." from the popup menu.  The files will still be properly included via the Fortran INCLUDE statements, but Simply Fortran won't attempt to compile them separately.

Jeff Armstrong
Approximatrix, LLC

Re: Linker Input Error

That did the trick. Thank you very much for your help, Jeff.