OS/2 Considerations

In most respects, linking a program for OS/2 is similar to linking a program for DOS. The principal difference is that most programs created for DOS run as stand-alone applications, whereas programs for OS/2 generally call one or more dynamic-link libraries. See What Is a Dynamic-Link Library? and Advantages of Dynamic Linking.

Import and Export Definitions

Each dynamic-link library (.DLL file) defines export definitions that tell OS/2 what functions the library has. Functions not exported can only be called from within the library. Each export definition specifies a function name.

Conversely, each executable program (.EXE file) defines import definitions that tell OS/2 which dynamic-link functions the program needs and where they can be found. Otherwise, OS/2 would not know which dynamic-link libraries to load when the program is run. Each import definition specifies a function name and the .DLL file where the function resides.

Methods of OS/2 Linking

There are two methods of OS/2 Linking:

Linking with an import library requires more steps but has certain advantages.


[Back: /INF and /M Output Example]
[Next: What Is a Dynamic-Link Library?]