The moose likes General Computing and the fly likes creating dll Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » General Computing
Bookmark "creating dll" Watch "creating dll" New topic

creating dll

chetan dhewal
Ranch Hand

Joined: Nov 07, 2000
Posts: 61
How to create dll using Turbo C++ 3.0?

Chetan Dhewal<br />SCMAD,SCJP 1.2
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63865

Nothing to do with Java, so moved to General Computing.

[Asking smart questions] [About Bear] [Books by Bear]
Travis Hein
Ranch Hand

Joined: Jun 06, 2006
Posts: 161
I am not sure that turbo c++ 3.0 supports a generating a DLL, as it was built for work with DOS executables, and DLL's as we know them today didn't exist back then. At least that is what I am seeing with the tlink v5.0 with my turbo c++ 3.0.

A dynamic link library, is a shared library that is loaded at run time by the operating system, when an executable program being loaded would depend on features in that library. Once it is loaded, it can then be shared between other applications that are also running.
DLL is a binary file format, that relies on the compiler and linker tools to build code that is relocatable, and depends on the features of the operating system to know how to load and use a DLL as they are needed.

Turbo C++ does support making a library though, with tlib. This is where I can compile sources for common utilities and place the built results into a .lib file, which can later be used and reused to (statically) link with other source files as I build them.
Would that be what you were wanting to do?

If a DLL is really what is wanted, it can be built using the usual compile form c(pp) sources into .obj files, and then specifying options to tlink to make it into a dll. Though your header files would need to say that your code exists, but not here, for example, specify that the function is in an external location, and uses the C calling convention:
extern "C" void f(int);

Then with tlink v7.0 (comes with borland c++ 4.5, or tasm 4.1) supports the /Td switch, which means build a .dll file instead of a .exe output.

Though I have never tried it, I guess you could try to use the newer tlink with the tc 3.0, as long as you don't use the tiny memory model, since the relocation for .com files will not work with .dll files.
But I still think the output .dll file would not work in DOS.?

Error: Keyboard not attached. Press F1 to continue.
I agree. Here's the link:
subject: creating dll
jQuery in Action, 3rd edition