Microsoft KB Archive/68158

= Basic 7.10 LINK &quot;L4051 Cannot Find Library&quot; If Using 7.00 .LIB =

Article ID: 68158

Article Last Modified on 10/20/2003

-

APPLIES TO


 * Microsoft BASIC Professional Development System 7.0
 * Microsoft BASIC Professional Development System 7.1

-



This article was previously published under Q68158



SUMMARY
If you get the linker warning message &quot;L4051 : BCL70xxx.LIB : cannot find library&quot; while linking a program in Basic PDS version 7.10, the problem may be that you are linking to a .LIB library you created with Basic PDS 7.00. This will happen even if Basic PDS version 7.00 has been deleted from your hard disk. If you created your own .LIB library in 7.00 and then link it to your Basic 7.10 module, then you will need to recompile the Basic routines in the .LIB using Basic version 7.10 and rebuild the .LIB library (using the LIB.EXE Library Manager).

The L4051 error can also occur because of an incorrectly set LIB path. Type SET at the MS-DOS command line to be sure that the LIB environment variable points to the Basic 7.10 libraries. You can set the LIB path (automatically at boot time) in your AUTOEXEC.BAT batch file as follows: SET LIB=C:\BC71\LIB This information applies to Microsoft Basic Professional Development System (PDS) version 7.10 for MS-DOS and MS OS/2.



MORE INFORMATION
To duplicate the &quot;L4051 : cannot find library&quot; warning, build a library from the following code using Basic version 7.00: 'test.bas 'demo file built with Basic PDS 7.00 SUB Pds70sub print &quot;this is from the library built with PDS 7.00&quot; END SUB Compile and build the library as follows in Basic version 7.00:   BC /O /Fs test ; LIB mylib + test ;       [builds MYLIB.LIB] LINK /Q mylib.lib,mylib.qlb,,qbxqlb.lib ;   [links MYLIB.QLB] Then create a module to CALL the above SUBprogram Pds70sub from the library MYLIB: 'main.bas 'This module calls the SUBprogram in a library created with PDS 7.00 print &quot;this is the calling module&quot; call pds70sub Compile and link as follows in Basic version 7.10:   BC /O /Fs main ; LINK main,,,BCL71EFR.LIB + MYLIB.LIB ; Now you should receive the warning message:

LINK : warning L4051 : BCL70EFR.lib : cannot find library

Enter new file spec:

To correct the problem, recompile, relink, and rebuild the library MYLIB using Basic PDS version 7.10.

Additional query words: BasicCom

Keywords: KB68158

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.