Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RE: Can Borland C++ create a standard Windows DLL from .lib file

Status
Not open for further replies.

Sjhaw

Programmer
May 14, 2011
9
0
0
US
Can Borland C++ (version 4.5) create a standard Windows DLL from functions in the *.lib files?

I am trying to use PBCC 5.05 (PowerBasic Console Compiler for Windows) to convert my MB86 source code. The main problem is accessing functions contained in .lib files that came with MB86. For your info, MB86 (from Minnow Bear Computer) is an upgraded version of CBasic from Digital Research. It generates 32 bit DOS compatible C code. The following example shows the three steps involved in creating an executable program file (OM.EXE in the example):

1. MB86 translates a CBasic source code (OM.BAS in the example) into C;
2. compiles that C into an object file using Borland C++ 4.5; and
3. links that object file using Borland C++ 4.5 linker with function libraries (.lib files). The lib files (tltools.lib, tlmb86.lib, tlutil.lib, and sort.lib), which came with MB86, contain functions written in C and assembly language for 32 bit MB86.

Example:

MB86 OM
bcc -c -ml -w- OM.C
TLINK c0l om,om.exe,,tltools tlmb86 tlutil sort cl

The said *.lib files are not directly usable with PowerBASIC Console Compiler. If Borland C++ 4.5 can create a standard Windows DLL from functions in the *.lib files, the DLL files can be used with my newly purchased PBCC 5.05. Perhaps you can create the DLL files.

If you need to inspect the .lib files or need any MB 86 documentation, please let me know. Thanks in advance for your assistance.

 
AFAIK, you cannot directly convert library functions to DLLs. Having said that, you can create interfaces to the library functions, link the library, and create DLLs. I suspect that this would be a laborious task, though.

James P. Cottingham
[sup]I'm number 1,229!
I'm number 1,229![/sup]
 
Thanks, James. I find that both LIBs and DLLs came with MB86. So I do have 32bit DLLs version. Any tool you know of to view the contents of DLLs and LIBS file?
 
The only tool I know for viewing compiled programs will "decompile" them in assembly language. I think there are a thread in this forum about that. Do a search an see if you can find it.

Since I'm not familiar with MB86 I hesitate to say what the DLLs are.


James P. Cottingham
[sup]I'm number 1,229!
I'm number 1,229![/sup]
 
Compiling and linking using Borland C++ 4.5

I get the following error messages:

Compiling:
Error: could not find file 'c.cpp"

Linking:
Fatal: Unable to open file 'mbsup56b.lib"


Borland C++ 4.5 allows creation of protected mode DOS applications using the the 32 bit DLL version of run-time libraries.
Step 1:. compiling C source code into an object file using Borland C++ 4.5; and
Step 2: linking the resulting object file using Borland C++ 4.5 32 bit linker with 32 bit DLL version of run-time libraries.

I am trying to link the following DLLs (containing MB86 run-time routines written in C and assembly language).

mbsup56b.dll
mbutl56b.dll
mb32i56b.dll

I am also trying to link:

cw3215.dll


The options for BCC32.EXE are:
option output
-WX DPMI32.EXE

The options for TLINK32.EXE are:
option output
-Tpe -ax DPMI32.EXE


bcc32 -r- -w- c -WX myexample.C
tlink32 -Tpe -ax c:\bc45\lib\c0x32 myexample,myexample.exe,,mbsup56b mbutl56b mb32i56b dpmi32 cw3215

Thanks for your assistance.

 
Hello

Could you tell me from where did you get MB86, Minnow Bear Computers look out of business for this product.

Thank Christophe
 
>Could you tell me from where did you get MB86,
In 1987, I purchased MB86, a Minnow Bear Computers product that translates Cbasic to C source code as well as allows mixing of C with CBasic. Until 1996, I had been purchasing the MB86 updates. Unfortunately, through google search I found out that Michael E. Nunamaker, the owner of Minnow Bear Computers, to me a genius, changed his business to horse racing research. According to his website,"Currently, Mr. Nunamaker spends the bulk of his time on computer consulting work."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top