Compiling and linking the application

This section gives information on libraries, linking, and header files.

NoteClient-Library and Server-Library now support dynamic loading of Net-Library, directory, and security drivers. This change affects the way you link Client-Library, Server-Library, and Embedded SQL applications.

From this version onward, you no longer need to explicitly link the following object files with your applications:

The following tables list the general forms of the commands for compiling and linking Embedded SQL/C applications on Sybase supported platforms running the UNIX operating system.

Table 5-1 shows the commands for compiling and linking Embedded SQL/C applications using static libraries.

Table 5-1: Static link-and-compile commands for Embedded SQL/C

Platform

Command

Sun Solaris 2.x

/opt/SUNWspro/bin/cc -I$SYBASE/include -L$SYBASE/lib \
     APP_FILES -lct -lcs -ltcl -lcomn -lintl -Bdynamic 
    -lnsl -ldl -lm -o program

IBM RS/6000

xlc_r4 -I$SYBASE/include -L$SYBASE/lib APP_FILES -lct \
        -lcs -ltcl -lcomn -lintl -lm -o program

HP 9000(8xx)

cc -I$SYBASE/include -L$SYBASE/lib APP_FILES [-W1,-a,archive] \
     -lct -lcs -ltcl -lcomn -lintl -Wl,-a,default -lcl -lm \
    -lBSD -ldld -Wl, -E, +s -o program

SGI

cc -o [-n32 | -n64] -mips3 -I$SYBASE/include -Bstatic APP_FILES \
   -L$SYBASE/lib -lct -lcs -ltcl -lcomn -lintl \
    -Bdynamic -lm -o program 

HP Tru64 UNIX

cc -I$SYBASE/include -L$SYBASE/lib APP_FILES -lct -lcs -ltcl \
 	-lcomn -lintl -lm -o program

Linux

cc -I$SYBASE/$SYBASE_OCS/include-L$SYBASE/$SYBASE_OCS/lib APP_FILES-lct -lcs -lsybtcl -lcomn -lintl -rdynamic -ldl -lnsl -lm -o program

Table 5-2 shows the commands for compiling and linking Embedded SQL/C applications using debug libraries.

Table 5-2: Debug link-and-compile commands for Embedded SQL/C

Platform

Command

Sun Solaris 2.x

/opt/SUNWspro/bin/cc -I$SYBASE/include -L$SYBASE/devlib \
    -g APP_FILES -lct -lcs -ltcl -lcomn -lintl -Bdynamic 
    -lnsl -ldl -lm -o program

IBM RS/6000

xlc_r4 -I$SYBASE/include -L$SYBASE/devlib -g APP_FILES \
     -lct -lcs -ltcl -lcomn -lintl -lm -o program

HP 9000(8xx)

cc -I$SYBASE/include -L$SYBASE/devlib -g APP_FILES \
    [-Wl,-a,archive] -lct -lcs -ltcl -lcomn -lintl \
     -Wl,-a,default -lcl -lm -lBSD -ldld -Wl, -E, +s -o program

SGI

cc -g [-n32 | -n64] -mips3 -I$SYBASE/include -L$SYBASE/devlib \
    APP_FILES -lct -lcs -ltcl -lcomn -lintl -lm -o program 

HP Tru64 UNIX

cc -I$SYBASE/include -L$SYBASE/devlib APP_FILES -lct -lcs \
 	 -ltcl _oldstyle_liblookup -lcomn -lintl -lnsl -lm -o program

Linux

cc -I$SYBASE/$SYBASE_OCS/include-L$SYBASE/$SYBASE_OCS/devlib APP_FILES-lct -lcs -lsybtcl -lcomn -lintl -rdynamic -ldl -lnsl -lm -o program

Table 5-3 shows the commands for compiling and linking Embedded SQL/C applications using shareable libraries (with dynamic drivers).

Table 5-3: Shareable link-and-compile commands for Embedded SQL/C

Platform

Command

Sun Solaris 2.x

cc -I$SYBASE/include -L$SYBASE/lib APP_FILES \
    $SYBASE/include/sybesql.c -lct -lcs -ltcl \
    -lcomn -lintl -ltli -lnsl -ldl -lm -o program

HP 9000(8xx)

cc -I$SYBASE/include -L$SYBASE/lib APP_FILES \
    $SYBASE/include/sybesql.c -lct -lcs -ltcl \
    -lcomn -lintl -linsck -Wl -lcl -lm -lBSD -o program

SGI

cc [-n32 | -n64] -mips3 -I$SYBASE/include -L$SYBASE/lib APP_FILES \
   -lct -lcs -ltcl -lcomn -lintl -ldl -lm -o program 

HP Tru64 UNIX

cc -I$SYBASE/include -L$SYBASE/lib APP_FILES \
 	-oldstyle_liblookup -lct -lcs -ltcl-lcomn \
 	-lintl -lm -o program

Linux

cc -I$SYBASE/$SYBASE_OCS/include-L$SYBASE/$SYBASE_OCS/devlib APP_FILES-lct -lcs -lsybtcl -lcomn -lintl -rdynamic -ldl -lnsl -lm -o program

NoteThe object produced by compiling the sybesql.c file contains utility routines that are used by Embedded SQL/C applications. You must link sybesql.o in with every application for the application to work properly.

For HP-UX system users: