beautypg.com

Linking libraries in managed builds, Entering a shared library, Adding libraries to link – HP Integrity NonStop H-Series User Manual

Page 108

background image

Linking libraries in managed builds

To link an application against libraries, use the normal mechanisms that compilers provide by
putting the options in the list of Additional options in the Linker tool's Miscellaneous page. You
also need to link against librld.so to enable your application to load dynamic libraries.

For example, if your TNS/E C application needs to link against two shared libraries, one named
stdll.tso

in project StaticDLL and the other named dydll.tso in project DynamicDLL, you

would perform the following steps to link your main application against the libraries:

1.

In the NonStop Project Explorer view, select the project that depends on stdll.tso and
dydll.tso

.

2.

Select Properties from the context menu for the NonStop Project Explorer view to open the
Properties page for the selected project.

3.

In the Properties page, select C/C++ Build > Settings on the left to open the Settings page.
The Tool Settings tabbed page will be open by default.

4.

Select the Miscellaneous entry under the C Linker (TNS/E) tool.

5.

Select the Add button (

) for Additional options to open the Enter Value dialog.

6.

in the Enter Value dialog, enter -Weld= followed by the linker option used to specify libraries
(-lib) as shown in

Figure 70 (page 108)

.

Figure 70 Entering a shared library

7.

Select OK to dismiss the Enter Value dialog and to add the -Weld option to Other objects.

8.

Repeat steps 5 through 7, but specify the path to dydll.tso instead of stdll.tso.

Figure 71

(page 108)

shows the Additional options list with the two libraries added.

Figure 71 Adding libraries to link

9.

Optional: Repeat steps 5 through 8 for other build configurations. (Select a different build
configuration in the Configuration combo box, then repeat steps 5 through 8. Make sure to

108 Tasks

This manual is related to the following products: