Previous Page Contents Page Next Page

3.6 Compiling and Linking the HLLAPI Application

When compiling your HLLAPI application, specify the following option to indicate to the compiler which directory contains the SNAP-IX header files your application requires:


-I /usr/include/sna (for SNAP-IX)

-I /usr/include/tn3270 (for SNAP-IX TN3270)

SNAP-IX only (not SNAP-IX TN3270): For a 64-bit application, specify the following option to indicate use of the sparcv9 (64-bit) architecture instruction set. Use this option if you want to compile the application in 64-bit mode. To compile in 32-bit mode, do not specify this option.

-xarch=v9

When linking your HLLAPI application, use the following options:

SNAP-IX (not SNAP-IX TN3270) on Specifies use of the sparcv9 (64-bit) architecture instruction set. Use this option if you want to link the application in 64-bit mode. To link in 32-bit mode, do not specify this option.

Indicates the directory containing one or more libraries to be used when linking the application.

This directory is normally /opt/sna/lib, except for 64-bit SNAP-IX applications where it is /opt/sna/lib/sparcv9.

Indicates the name of a library to be used when linking the application.

Indicates the directory containing one or more libraries to be used by the application at run time.

This directory is normally /opt/sna/lib, except for 64-bit SNAP-IX applications where it is /opt/sna/lib/sparcv9.

As an alternative to the option, you can set the environment variable LD_RUN_PATH to /opt/sna/lib before compiling and linking the application.

Indicates a preprocessor directive to be used by the compiler. Do not include any space between and the name of the preprocessor directive.

For single-threaded applications, link with the following options:

-L /opt/sna/lib -R /opt/sna/lib -lhapi (for SNAP-IX)

-L /opt/tn3270/lib -R /opt/tn3270/lib -lhapi (for SNAP-IX TN3270)

A multithreaded application can use either Solaris threads or POSIX threads. Refer to the Solaris Programmer's Guide for multithreaded programs for more information on using each type of threads. The following options are suitable for linking most applications:


-D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -L /opt/sna/lib -R /opt/sna/lib -lhapi_r
 (for SNAP-IX)
-xarch=v9 -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -L /opt/sna/lib/sparcv9
 -R /opt/sna/lib/sparcv9 -lhapi_r
 (for a 64-bit SNAP-IX application)
-D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -L /opt/tn3270/lib -R /opt/tn3270/lib -lhapi_r
 (for SNAP-IX TN3270)

Note

If you are using the standard Solaris compiler /usr/ucb/cc , you may encounter compiler errors indicating that the library libucb.so.1 could not be found. If this occurs, add /usr/ucblib to the compiler options you use to link the program.

Previous Page Contents Page Top of Page Next page