How to Link Basic 7.1 with C 5.1, FORTRAN 5.0, and Pascal 4.0Last reviewed: May 30, 1996Article ID: Q66428 |
SUMMARYThis article explains how to get some library files from the Microsoft Software library, and it describes how to link Microsoft Basic PDS version 7.1 with C version 5.1, FORTRAN version 5.0, or Pascal version 4.0 for MS- DOS. It is designed only for owners of Microsoft Basic Professional Development System (PDS) version 7.1, Microsoft C Compiler version 5.1, Microsoft FORTRAN Compiler version 5.0 or 5.1, and Microsoft Pascal Compiler version 4.0 for MS-DOS. If you have FORTRAN Compiler version 5.1, please also review the following article in the Microsoft Knowledge Base: ARTICLE-ID:Q79825 TITLE :BUG: Initialization Problem with FORTRAN and BasicTo get the library files:
You can find BB0345.EXE (size: 408176 bytes) , a self-extracting file, on these services: On the www.microsoft.com home page, click the Support icon Click Knowledge Base, and select the product Enter kbfile BB0345.EXE (size: 408176 bytes) , and click GO! Open the article, and click the button to download the file ftp ftp.microsoft.com Change to the Softlib/Mslfiles folder Get BB0345.EXE (size: 408176 bytes) On the Edit menu, click Go To, and then click Other Location Type "mssupport" (without the quotation marks) Double-click the MS Software Library icon Find the appropriate product area Locate and Download BB0345.EXE Dial (206) 936-6735 to connect to MSDL Download BB0345.EXE (size: 408176 bytes) For additional information about downloading, please see the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q119591 TITLE : How to Obtain Microsoft Support Files from Online ServicesRun BB0345.EXE in an empty directory to get the following three files: LLIBCER.LIB, LLIBCAR.LIB, and READ.ME. The READ.ME file repeats all information from this article.
MORE INFORMATION
HOW TO LINK Basic PDS 7.1 WITH C 5.1, FORTRAN 5.0, OR PASCAL 4.0
IntroductionThis article describes how to link Basic Professional Development System (PDS) version 7.1 with C 5.1, FORTRAN 5.0, or Pascal 4.0. This information applies only to Microsoft Basic PDS version 7.1, Microsoft C Compiler version 5.1, Microsoft FORTRAN Compiler version 5.0, and Microsoft Pascal Compiler version 4.0 for MS-DOS. Basic programs compiled with Microsoft Basic PDS 7.1 use the Microsoft C version 6.0 and QuickC 2.50 format for start-up code and memory allocation. This format has changed so dramatically between C 5.1 and C 6.0 that Basic PDS 7.1 is not directly compatible with C 5.1, FORTRAN 5.0, or Pascal 4.0 (which use the C 5.1 format for start-up code and memory allocation).
NOTE: Microsoft Basic PDS 7.1 is compatible with Microsoft C PDS 6.0. Basic PDS 7.0 is compatible with C 5.1, but Basic PDS 7.1 is not directly compatible with C 5.1 unless you use the method described in this application note.To make Basic PDS 7.1 compatible with C 5.1, FORTRAN 5.0, or Pascal 4.0, you must alter the FORTRAN or Pascal language libraries and incorporate modules from the C 6.0 run-time libraries, as explained further below. The files you downloaded from the MSL include the following two C 6.0 run- time libraries (which were built by running the C 6.0 SETUP.EXE program and choosing no GRAPHICS.LIB and no PGCHART.LIB included in the combined libraries):
LLIBCER.LIB and LLIBCAR.LIBThese provided files support only the large memory model, the emulation and alternate math packages, and the MS-DOS (or real mode under OS/2) operating system.
Pascal 4.0To make Basic PDS 7.1 compatible with Pascal 4.0, perform the following steps:
FORTRAN 5.0To make Basic PDS 7.1 compatible with FORTRAN 5.0, perform the following steps:
Linking Your Compiled ProgramsOnce you have modified the Pascal or FORTRAN library (Newmixed.LIB as described above) and you have compiled your Pascal or FORTRAN source file(s), you must link your object modules with the proper libraries in the proper order. In the LINK command line, you must specify the Basic library first, the C 6.0 library LLIBCER.LIB or LLIBCAR.LIB (included with this application note) second, and your new Pascal or FORTRAN library (Newmixed.LIB) last. You also must link with the /NOD and /NOE options to ensure that the default libraries the object files normally use are ignored and only the libraries you explicitly list are used. The following is an example
LINK /NOD/NOE Bas1.OBJ + Mixed.OBJ, Bas1.EXE,,BRT71ENR.LIB + LLIBCER.LIB + Newmixed.LIB;where Bas1.OBJ is your Basic main program, and Mixed.OBJ is your Pascal or FORTRAN object module.
C 5.1To make Basic PDS 7.1 compatible with C 5.1, you must use a method different from the method used above for Pascal or FORTRAN. Because the Basic PDS 7.1 and C 5.1 libraries aren't designed to be compatible, there isn't an easy way to make the two libraries work together. In this case, you must use the provided C 6.0 run-time libraries, which provide support for emulator (/FPi) (LLIBCER.LIB) and support for alternate math (/FPa) (LLIBCAR.LIB) support for MS-DOS. The following are examples of the required Basic 7.1 and C 5.1 compiling and linking steps
BC /FPi /O Btest.BAS; CL /c /AL /FPi Ctest.C LINK /NOD /NOE Btest + Ctest,,,BCL71ENR.LIB LLIBCER.LIB;where the LLIBCER.LIB file above is one of the two C 6.0 libraries (LLIBCER.LIB or LLIBCAR.LIB) provided with this application note. (Don't use the C 5.1 run-time library of the same name.)
Final Note on CompatibilityAlthough the above methods have been designed to produce compatible results, we have not put them through a standard Microsoft mixed- language testing cycle, and it is possible that you may still encounter compatibility problems under certain conditions. We cannot guarantee the complete success of mixed-language programming of Basic 7.1 with C 5.1, FORTRAN 5.0, or Pascal 4.0. Further problems or questions can be directed to Microsoft Language Support Services.
|
Additional reference words: BasicCom 5.10 5.00 4.00 softlib
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |