PRB: __FF_intrin_err Link Error L2025 with Basic PDS Code
ID: Q91736
|
The information in this article applies to:
-
Microsoft FORTRAN for MS-DOS, version 5.1
-
Microsoft Basic Professional Development System for MS-DOS and OS/2, version 7.1
-
Microsoft FORTRAN for OS/2, version 5.1
SYMPTOMS
When linking a mixed-language application using FORTRAN version 5.1 and
Basic Professional Development System version 7.1, using the stand-alone
Basic libraries, the linker generates the following error message:
error L2025: __FF_intrin_err : symbol defined more than once
When linking with the run-time support Basic libraries, the following
linker errors are generated:
error L2025: __flds : symbol defined more than once
error L2025: __fsts : symbol defined more than once
error L2025: __fadds : symbol defined more than once
error L2025: __fdivs : symbol defined more than once
error L2025: __fsubs : symbol defined more than once
error L2025: __fmuls : symbol defined more than once
error L2025: __fstsp : symbol defined more than once
error L2025: __aFflds : symbol defined more than once
error L2025: __aFfsts : symbol defined more than once
error L2025: __fdivsr : symbol defined more than once
error L2025: __fsubsr : symbol defined more than once
error L2025: __aFfadds : symbol defined more than once
error L2025: __aFfdivs : symbol defined more than once
error L2025: __aFfsubs : symbol defined more than once
error L2025: __aFfmuls : symbol defined more than once
error L2025: __aFfstsp : symbol defined more than once
error L2025: __aFfdivsr : symbol defined more than once
error L2025: __aFfsubsr : symbol defined more than once
error L2025: __fabs : symbol defined more than once
error L2025: __fxch : symbol defined more than once
error L2025: __fldt : symbol defined more than once
error L2025: __fldz : symbol defined more than once
error L2025: __ftst : symbol defined more than once
error L2025: __fsttp : symbol defined more than once
error L2025: __aFfabs : symbol defined more than once
error L2025: __aFfxch : symbol defined more than once
error L2025: __aFfldt : symbol defined more than once
error L2025: __aFfldz : symbol defined more than once
error L2025: __aFftst : symbol defined more than once
error L2025: __aFfsttp : symbol defined more than once
CAUSE
Both the Basic and FORTRAN library modules define the same symbols.
Compiling with the /NOE option does not address this error.
RESOLUTION
Linker error L2025 indicates that code defines a symbol more than once. The
problem occurs only when the code that resolves the symbols is
significantly different. Because only one linker error occurs when the
Basic code is compiled with the /o option switch and linked with the stand-
alone library, use only the stand-alone libraries in mixed-language
programming situations.
Because the __FF_intrin_err routine in the Basic library appears to
function correctly when a FORTRAN intrinsic function error occurs, ignore
the one L2025 link error. However, floating-point intrinsic function run-
time errors will appear in Basic error code format rather than FORTRAN
error code format. If the /4Yb compiler option or ($DEBUG metacommand) is
used, errors will not trace back to the source line on which the problem
occurred.
MORE INFORMATION
By default, when Basic code is linked with the stand-alone libraries, it
references the routine __FF_intrin_err. This symbol is resolved in the
87BDISP.OBJ module in the stand-alone Basic library. When FORTRAN code
calls intrinsic functions, such as SQRT, the code refers to internal
routines in the FORTRAN run-time library module FUNMSG.OBJ. Because
FUNMSG.OBJ also defines the __FF_intrin_err symbol, the L2025 linker error
occurs. The /NOE link option does not address this situation.
When Basic code that contains floating-point operations reference is made
to low-level internal floating-point routines (like __flds). When this code
is linked to the Basic run-time support libraries, the calls are resolved
in the RTMINT4.OBJ module in the Basic library. FORTRAN code that contains
floating-point operations references routines in the 87FCALLS.OBJ and
EMCCALLF.OBJ modules in the FORTRAN library. Because these modules contain
many of the same symbols as the RTMINT4 module, thirty L2025 errors occur.
It is not possible to remove any of the modules that contain duplicated
symbols from either library because other functions in the modules contain
required routines. Removing modules would cause the linker to issue
"unresolved external" errors.
The following project reproduces the problem:
FORTRAN Source Code FTEST.FOR
subroutine fortsub
x = 2.
x = x**x
x = sqrt(x)
print*, x
end
Basic PDS Source Code BTEST.BAS
DIM HEAP%(2048)
COMMON SHARED /NMALLOC/ HEAP%()
DECLARE SUB FINIT CDECL ALIAS "__FFinit"
DECLARE SUB FORTSUB
DIM A AS SINGLE
CALL FINIT
A = 2.0
A = A^A
CALL FORTSUB
END
Makefile
all: test.exe
ftest.obj : ftest.for
fl /c /Zi /Od /FPc ftest.for
btest.obj : btest.bas
bc /o /Fs /Zi /Lr btest.bas;
test.exe : ftest.obj btest.obj
link /NOD /NOE /CO btest ftest,test.exe,nul,bcl71efr llibfor7;
Additional query words:
nofps b_basiccom 5.10 7.10
Keywords :
Version : :5.1,7.1
Platform :
Issue type :