|
|
|
|
This section summarizes processing considerations of which you must be aware when developing LU0 applications on a Solaris computer.
Applications access LU0 using the functions defined in the LU0 header file /usr/include/sna/lu0_c.h. To use LU0 functions in your application, include the LU0 header file in the application's source code:
#include <lu0_c.h>
This file contains the definitions of the LU0 functions. It also includes the common interface header file /usr/include/sna/values_c.h; these two files contain all the constants defined for supplied and returned parameter values at the LU0 interface.
If the process that issued lu0_init then forks to create a child process, the child process cannot issue any LU0 functions on a session started by the parent process; the functions will fail with an error return code. It can, however, issue another lu0_init to obtain its own session.
Applications are compiled with different options in order to select one of the scheduling modes described in Scheduling Asynchronous Events.
Applications that use asynchronous API callbacks must either be built as multithreaded applications or include support for the application scheduled mode. Motif applications must include the code fragment described in Motif Applications.
When compiling your LU0 application, use the following options:
Indicates the directory containing one or more header files your application requires.
Specifies 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.
When linking your LU0 application, use the following options:
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 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 applications where it is /opt/sna/lib/sparcv9 .
As an alternative to the option, you can set the
environment variable
Indicates a preprocessor directive to be used by the compiler. Do not include any space between and the name of the preprocessor directive.
The command you use to link the application depends on which type of application it is, as described below.
For a 64-bit application, link with the following options:
-xarch=v9 -L /opt/sna/lib/sparcv9 -R /opt/sna/lib/sparcv9 -llu0 -lfmapi -lsna
For a 32-bit application, link with the following options:
-L /opt/sna/lib -R /opt/sna/lib -llu0 -lfmapi -lsna
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.
Check your Motif documentation for information on which libraries and other options are required to link your Motif application.
For Solaris, 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 -llu0 -lfmapi
-lsna_r -lthreadFor a 64-bit application, link with the following options:
-xarch=v9 -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -L /opt/sna/lib/sparcv9
-R /opt/sna/lib/sparcv9 -llu0 -lfmapi -lsna_r -lthread
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.
|
|
|
|
|