Compile-and-link lines for multithreaded applications

Table 1-7 shows commands for compiling and linking Client-Library applications with libraries to take advantage of thread-safe support.

Table 1-7: Thread-safe link-and-compile commands for Client-Library

Platform

Command

Sun Solaris 2.3 and later

/opt/SUNWspro/bin/cc 
-I$SYBASE/$SYBASE_OCS/$SYNASE_OCS/include 
-L$SYBASE/$SYBASE_OCS/$SYBASE_OCS/lib -g \
-D_REENTRANT APP_FILES OCS_LIBS -lcs_r -ltcl_r -lcomn_r \-lintl_r -Bdynamic -lnsl -ldl -lpthread 
-lthread -lm -o program

IBM RS/6000

xlc_r4 -I$SYBASE/$SYBASE_OCS/$SYBASE/$SYBASE_OCS/
$SYBASE_OCS/include -L$SYBASE/$SYBASE_OCS/$SYBASE/$SYBASE_OCS
$SYBASE/$SYBASE_OCS/$SYBASE_OCS/lib -g 
-D_THREAD_SAFE \APP_FILES OCS_LIBS -lcs_r 
-ltcl_r -lcomn_r -lintl_r \
-lxdsxom -lpthread -lm -o program

HP 9000(8xx)

cc -I$SYBASE/$SYBASE_OCS/$SYBASE/$SYBASE_OCS/$SYBASE_OCS/include -L$SYBASE/$SYBASE_OCS/$SYBASE_OCS/lib -g 
-D_THREAD_SAFE \-D_REENTRANT -Ae APP_FILES OCS_LIBS -lcs_r \-ltcl_r -lcomn_r -lintl_r -Wl,
-a,default -lcl -lm -lBSD \
-lpthread -lc_r -ldld -Wl,-E,+s -o program

HP Tru64 UNIX

cc -I$SYBASE/$SYBASE_OCS/include -L$SYBASE/$SYBASE_OCS/lib -threads APP_FILES \OCS_LIBS -lcs_r -ltcl_r -lcomn_r -lintl_r -lm 
-o program

Linux

cc -I$SYBASE/$SYBASE_OCS/include-L$SYBASE/$SYBASE_OCS/vlib APP_FILES OCS_LIBS-lcs_r -lsybtcl_r -lcomn_r -lintl_r -rdynamic -ldl -lpthread -lnsl -lm -o program

In the link-and-compile lines listed in Table 1-4 through Table 1-7:

For HP-UX system users:

For SGI users:

NoteYou must set the environment variable LD_LIBRARY_PATH to $SYBASE/$SYBASE_OCS/lib to run programs linked with shareable (dynamic) libraries. If you are running in debug mode, set LD_LIBRARY_PATH to $SYBASE/$SYBASE_OCS/devlib to run the program.

For HP Tru64 UNIX users:

The library file extensions for HP Tru64 UNIX are .a for static libraries and .so for sharable libraries. Use the following general command form to compile and link a Client-Library application:

Nonthreaded non-reentrant libraries

Threaded reentrant libraries