6 Creating and Using Libraries

Many libraries come with HP-UX. You can also create and use your own libraries on HP-UX. This chapter discusses the following topics:

General Information About Shared and Archive Libraries

“Overview of Shared and Archive Libraries” (page 89)

Overview of Shared and Archive Libraries

HP-UX supports two kinds of libraries: archive and shared. A shared library is also called a dll (dynamically linked library). Archive libraries are the more traditional of the two, but use of shared libraries has increased dramatically, and is the preferred method. The following table summarizes differences between archive and shared libraries.

Table 20 Differences between archive and shared libraries

Comparing

Archive

Shared (or dll)

 

 

 

file name suffix

Suffix is .a.

Suffix is .sl or .<version> on PA systems and .so or

 

 

.so.<version> on Itanium-based systems, where version is the

 

 

version number of the library.

 

 

 

creation

Combine object files with the ar

Combine object files with the ld command

 

command

 

 

 

 

Overview of Shared and Archive Libraries 89