Using Borland's Command Line Tools
Page 4: Static Linked and Dynamic Linked

Installation, First Use Multi-File Programs
Static Libraries Static Linked and Dynamic Linked
Make Files [1],  [2],  [3],  [4]  [Summary] Create and Use a DLL
Resource Files [1]

A dynamic linked library, DLL, is a file which supplies functions that programs can call.  It contains a table with the names of the functions and their addresses.  A program which uses the DLL is said to be dynamic linked to it.

When you build your program the instructions for the runtime library functions such as printf or cout are built into it.  If you have built another program then it also contains copies of those functions.  By using a DLL for those functions then only one copy of their code need be in memory and the programs do not contain copies of the functions so are smaller.

A program which is constructed to use a DLL version of the compiler's runtime library is said to be Dynamic Linked.  If it does not use the DLL then it contains the code from a static version of the runtime library and is said to be Static Linked.

On [Page 1] the command below was used to create a dynamic linked Hello World! program.
  bcc32 -WCR hello
DLLs that are used by a program are said to be imported by that program.   You can use tdump to show the DLLs that it imports.
  tdump -em. hello.exe
  (do not overlook the period at the end of "-em.")
  (if you are using a later version, you may have to use two dots "-em..")

  It will report the following:
  IMPORT:     KERNEL32.DLL
  IMPORT:       CC3250.DLL
Kernel32.DLL is part of what Windows provides and will be required by any Windows program.  Other Windows DLLs that are commonly used by programs are User32.DLL, Gdi32.DLL, ComCtl32.DLL, AdvApi32.DLL, Ole.DLL, OleAut32.DLL, ShlwApi.DLL and Shell32.DLL

The runtime library DLL that the program uses is CC3250.DLL  Any machine that uses this program will need to have that DLL installed.  Installation of it is easy.  Give the command PATH, find the system32 directory and place the DLL in there.  You must look at the path because the base directory varies between machines.

Two common places where the System32 directory is found are:
  C:\Windows\System32
    and
  C:\WinNT\System32

This command will create the same program but as static linked.  It does not use CC3250.DLL  The program it creates is larger because it contains the code for the runtime library functions instead of using the code in a DLL.
  bcc32 -WC hello
[Next Page: Make Files 1]

:: Main | Search | Site Map
 
:: Algorithms & Code
:: Assembly & Low Level
:: Borland/CodeGear
:: C & C++
:: CGI
:: CDROM Info
:: COM/DCOM/CORBA
:: Communications
:: Compression
:: Cryptography
:: File Formats
:: General Software
:: Games & Graphics
:: Hardware
:: HTML, Web Development
:: Linux/Unix/BSD
:: Microsoft
:: Miscellaneous
:: Neural Nets
:: New Links
:: Programming Articles
:: Programming Languages
:: Protocols
:: Sfwe Publications
:: Sfwe Sellers
:: Std Template Lib/STL
:: Tutorials, Refs: C/C++
:: Tutorials, Refs: Other
:: Utilities & Tools
:: XML & XHTML
:: Windows, Win32
:: 8051 & Embedded
  Programming Pages 
::  #1 #2 #3 #4 #5 #6 #7
Valid HTML 4.01 Strict