"Symbol Defined More Than Once"; Linking Basic and FORTRAN (39260)
The information in this article applies to:
- Microsoft QuickBASIC 4.0, when used with:
- the operating system: MS-DOS
- Microsoft QuickBASIC 4.0b, when used with:
- the operating system: MS-DOS
- Microsoft QuickBASIC 4.5, when used with:
- the operating system: MS-DOS
- Microsoft BASIC Compiler for MS-DOS and OS/2 6.0
- Microsoft BASIC Compiler for MS-DOS and OS/2 6.0b
This article was previously published under Q39260 SYMPTOMS
Mixed-language programming with Basic and FORTRAN may produce an
"L2025: Symbol defined more than once" linker error. The error occurs
even if the /NOE linker switch is used. Possible reasons for this
problem are version-dependent, as described below.
STATUS
Microsoft has confirmed this to be a bug in QuickBasic versions 4.00b and 4.50 and in Microsoft Basic Compiler versions 6.00 and
6.00b (buglist6.00, buglist6.00b). This problem was corrected in
Microsoft Basic Professional Development System (PDS) version 7.00
(fixlist7.00).
- Using math functions such as SIN, COS, and SQRT in a FORTRAN 5.00
subroutine linked into a Quick library can cause the L2025 linker
error in Basic PDS 7.00 (buglist7.00). This problem does not occur
when linking into an .EXE program (instead of into a Quick library),
or when not using FORTRAN math functions in the Quick library.
Compile and LINK the code example further below as follows to
duplicate Problem 3 in Basic PDS 7.00 and FORTRAN 5.00:
FL /c FORTRAN.FOR
LINK /Q /NOE /NOD FORTRAN.OBJ+QBX.LIB,,,QBXQLB.LIB LLIBFORE.LIB
This LINK gives about 28 L2025 errors, such as the following:
llibfore.lib(dos\crt0dat.asm) : error L2025:: __osversion :
symbol defined more than once
Code Example for Problems 2 and 3 (Above)
The following is a set of routines that demonstrate Problems 2 and 3
above. Note: If the Basic program is compiled with QuickBasic version
4.50 and the BC /O option is not used, Problem 2 does not occur.
=== Basic.BAS ===:
CALL ftest
END
=== FORTRAN.FOR ===:
subroutine ftest
real a,b,c,d,e,p,q,r,s,t
c = sin(d)
p = p/e**5
q = sqrt(r * r + s * s + t * t)
return
end
Modification Type: | Minor | Last Reviewed: | 1/9/2003 |
---|
Keywords: | KB39260 |
---|
|