Suse linux10 oracle c 开发一例

程序文件pp.pc

EXEC SQL BEGIN DECLARE SECTION;
    VARCHAR username[20];
    VARCHAR password[20];

EXEC SQL END DECLARE SECTION;

EXEC SQL INCLUDE sqlca;
int main()
{
    strcpy(username.arr,pcsp);
    username.len=strlen(username.arr);
    strcpy(password.arr,pcsp);
    password.len=strlen(password.arr);

    EXEC SQL CONNECTusername IDENTIFIED BYpassword;
    printf(nCOnnect to ORACLE as user;%sn,username.arr);
    return 0;

}

Makefile文件

INCLDIR= -I. -I/home/oracle/product/10.1.1/precomp/public -I/home/oracle/product/10.1.1/rdbms/public -I/home/oracle/product/10.1.1/rdbms/demo -I/home/oracle/product/10.1.1/plsql/pu
blic -I/home/oracle/product/10.1.1/network/public

DFLAGS= -DPRECOMP -DLINUX -D_GNU_SOURCE -DSLTS_ENABLE -DSLMXMX_ENABLE -D_REENTRANT -DNS_THREADS

CFLAGS= -O3

LIBPATH= -L/home/oracle/product/10.1.1/lib/

LIBS=-lclntsh `cat /home/oracle/product/10.1.1/lib/sysliblist` -ldl -lm

pp:pp.pc
        proc parse=no iname=pp.pc include=$(ORACLE_HOME)/precomp/public
 gcc  -o $@ [email protected] -I$(ORACLE_HOME)/precomp/public -L$(ORACLE_HOME)/lib -lclntsh -lclient10 $(LIBPATH) $(LIBS)

clean:
        rm *.lis pp.c pp

 

你可能感兴趣的:(Suse linux10 oracle c 开发一例)