PRB: __FF_intrin_err Link Error L2025 with Basic PDS Code

Last reviewed: July 18, 1995
Article ID: Q91736
The information in this article applies to:
  • Microsoft FORTRAN for MS-DOS and OS/2, version 5.1
  • Microsoft Basic Professional Development System for MS-DOS and OS/2, version 7.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 reference words: 5.10 7.10
KBCategory: kbtool kberrmsg kbprb
KBSubcategory: LnkIss


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 18, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.