Compile-and-link lines for non-threaded applications

The following tables list the general forms of the commands for compiling and linking non-threaded Client-Library applications on Sybase-supported platforms running on UNIX. Also, see the makefile and sybopts.sh file in $SYBASE/$SYBASE_OCS/sample/ctlibrary for compile and link information.

Table 1-4 shows commands for compiling and linking Client-Library applications using static libraries.

Table 1-4: Static compile-and-link commands for Client-Library

Platform

Command

Sun Solaris SPARC 32-bit and 64-bit

/opt/SUNWspro6.2/bin/cc 
-I$SYBASE/$SYBASE_OCS/include 
-L$SYBASE/$SYBASE_OCS/lib program.c 
-Bstatic -lsybct -lsybcs -lsybtcl -lsybcomn 
-lsybintl -lsybunic -Bdynamic -lnsl -ldl -lm 
-lsocket -o program

Sun Solaris x86-64 32-bit and 64-bit

/opt/SunStudio10/SUNWspro/bin/cc
-xtarget=opteron -xarch=amd64 
-I$SYBASE/$SYBASE_OCS/include 
-L$SYBASE/$SYBASE_OCS/lib program.c 
-Bstatic -lsybct -lsybcs -lsybtcl -lsybcomn 
-lsybintl -lsybunic -Bdynamic -lnsl -ldl -lm 
-lsocket -o program

IBM AIX RS/6000 32-bit and 64-bit

xlc -I$SYBASE/$SYBASE_OCS/include 
-L$SYBASE/$SYBASE_OCS/lib program.c
-Wl,-Bstatic -lsybct -lsybcs -lsybtcl -lsybcomn 
-lsybintl -lsybunic -lm -o program

HP HP-UX PA-RISC 32-bit and 64-bit

cc -I$SYBASE/$SYBASE_OCS/include 
-L$SYBASE/$SYBASE_OCS/lib program.c 
-Wl,a,archive -lsybct -lsybcs -lsybtcl -lsybcomn
-lsybintl -lsybunic -Wl,-a,default -lcl -lm -lBSD
-ldld -Wl,-E,+s -o program

HP HP-UX Itanium 32-bit and 64-bit

cc -I$SYBASE/$SYBASE_OCS/include 
-L$SYBASE/$SYBASE_OCS/lib program.c 
-Wl,a,archive -lsybct -lsybcs -lsybtcl -lsybcomn
-lsybintl -lsybunic -Wl,-a,default -lcl -lm -lBSD
-ldld -Wl,-E,+s -o program

Linux x86 32-bit

cc -I$SYBASE/$SYBASE_OCS/include 
-L$SYBASE/$SYBASE_OCS/lib program.c 
-Wl,-Bstatic -lsybct -lsybcs -lsybtcl -lsybcomn 
-lsybintl -lsybunic -Wl,-Bdynamic -ldl -lnsl 
-lm -o program

Linux POWER 32-bit and 64-bit

xlc -q32 -I$SYBASE/$SYBASE_OCS/include 
-L$SYBASE/$SYBASE_OCS/lib program.c 
-Wl,-Bstatic -lsybct -lsybcs -lsybtcl -lsybcomn 
-lsybintl -lsybunic -Wl,-Bdynamic -ldl -lnsl
-lm -o program

Linux x86-64 64 bit

gcc -I$SYBASE/$SYBASE_OCS/include
L$SYBASE/$SYBASE_OCS/lib program.c -lsybct64 
-lsybcs64 -lsybtcl64 -lsybcomn64 -lsybintl64 
-lsybunic64 -lld -lnsl -lm64 -o program

Table 1-5 shows commands for compiling and linking Client-Library applications using debug libraries.

Table 1-5: Debug compile-and-link commands for Client-Library

Platform

Command

Sun Solaris SPARC 32-bit and 64-bit

/opt/SUNWspro/bin/cc -g
-I$SYBASE/$SYBASE_OCS/include 
-L$SYBASE/$SYBASE_OCS/devlib program.c
-lsybct -lsybcs -lsybtcl -lsybcomn -lsybintl 
-lsybunic -lnsl -ldl -lm -lsocket -o program

Sun Solaris x86-64 32-bit and 64-bit

/opt/SunStudio10/SUNWspro/bin/cc
-xtarget=opteron -xarch=amd64 
-I$SYBASE/$SYBASE_OCS/include 
-L$SYBASE/$SYBASE_OCS/devlib program.c
-lsybct -lsybcs -lsybtcl -lsybcomn -lsybintl 
-lsybunic -lnsl -ldl -lm -lsocket -o program

IBM AIX RS/6000 32-bit and 64-bit

xlc -g -I$SYBASE/$SYBASE_OCS/include
-L$SYBASE/$SYBASE_OCS/devlib program.c 
-lsybct -lsybcs -lsybtcl -lsybcomn -lsybintl 
-lsybunic -lm -o program

HP HP-UX PA-RISC 32-bit and 64-bit

cc -g -I$SYBASE/$SYBASE_OCS/include 
-L$SYBASE/$SYBASE_OCS/devlib program.c 
-lsybct -lsybcs -lsybtcl -lsybcomn -lsybintl 
-lsybunic -lcl -lm -lBSD -ldld -o program

HP HP-UX Itanium 32-bit and 64-bit

cc -g -I$SYBASE/$SYBASE_OCS/include 
-L$SYBASE/$SYBASE_OCS/devlib program.c 
-lsybct -lsybcs -lsybtcl -lsybcomn -lsybintl 
-lsybunic -lcl -lm -lBSD -ldld -o program

Linux x86 32-bit

cc -g -I$SYBASE/$SYBASE_OCS/include
-L$SYBASE/$SYBASE_OCS/devlib program.c 
-lsybct -lsybcs -lsybtcl -lsybcomn -lsybintl 
-lsybunic -ldl -lnsl -lm -o program

Linux POWER 32-bit and 64-bit

xlc -q32 -g -I$SYBASE/$SYBASE_OCS/include
-L$SYBASE/$SYBASE_OCS/lib program.c
-lsybct -lsybcs -lsybtcl -lsybcomn -lsybintl 
-lsybunic -ldl -lnsl -lm -o program

Linux x86-64 64 bit

gcc -I$SYBASE/$SYBASE_OCS/include 
-L$SYBASE/$SYBASE_OCS/lib program.c -lsybct64 
-l sybcs64 -lsybtcl64 -lsybcomn64 -lsybintl64 
-lsybunic64 -lld -lnsl -lm64 -o program

Table 1-6 shows commands for compiling and linking Client-Library applications using shareable libraries (with dynamic drivers).

Table 1-6: Shareable compile-and-link commands for Client-Library

Platform

Command

Sun Solaris SPARC 32-bit and 64-bit

/opt/SUNWspro/bin/cc 
-I$SYBASE/$SYBASE_OCS/include 
-L$SYBASE/$SYBASE_OCS/lib 
-R$SYBASE/$SYBASE_OCS/lib program.c
-Bdynamic -lsybct -lsybcs -lnsl -ldl -lm 
-lsocket -o program

Sun Solaris x86-64 32-bit and 64-bit

/opt/SunStudio10/SUNWspro/bin/cc
-xtarget=opteron -xarch=amd64 
-I$SYBASE/$SYBASE_OCS/include 
-L$SYBASE/$SYBASE_OCS/lib 
-R$SYBASE/$SYBASE_OCS/lib program.c 
-Bdynamic -lsybct -lsybcs -lnsl -ldl -lm 
-lsocket -o program

IBM AIX RS/6000 32-bit and 64-bit

xlc -I$SYBASE/$SYBASE_OCS/include 
-L$SYBASE/$SYBASE_OCS/lib program.c
-Wl,-Bdynamic -lsybct -lsybcs -lm -o program

HP HP-UX PA-RISC 32-bit and 64-bit

cc -I$SYBASE/$SYBASE_OCS/include 
-L$SYBASE/$SYBASE_OCS/lib program.c 
-Wl,a,shared_archive -lsybct -lsybcs -lcl -lm 
-lBSD -o program

HP HP-UX Itanium 32-bit and 64-bit

cc -I$SYBASE/$SYBASE_OCS/include 
-L$SYBASE/$SYBASE_OCS/lib program.c 
-Wl,a,shared_archive -lsybct -lsybcs -lcl -lm 
-lBSD -o program

Linux x86 32-bit

cc -I$SYBASE/$SYBASE_OCS/include
-L$SYBASE/$SYBASE_OCS/lib program.c 
-Wl,-Bdynamic -lsybct -lsybcs -ldl -lnsl 
-lm -o program

Linux POWER 32-bit and 64-bit

xlc -q32 -I$SYBASE/$SYBASE_OCS/include
-L$SYBASE/$SYBASE_OCS/lib program.c
-Wl,-Bdynamic -lsybct -lsybcs -ldl -lnsl -lm
-o program

Linux

x86-64 64-bit

gcc -I$SYBASE/$SYBASE_OCS/include
-L$SYBASE/$SYBASE_OCS/lib program.c
-Wl,-Bdynamic -lsybct64 -lsybcs64 -ldl -lnsl 
-lm64 -o program