1751709 Members
4005 Online
108781 Solutions
New Discussion юеВ

Pro *C

 
Sandeep Ganguly
New Member

Pro *C

I have been using oracle 9.2.0.4 on hp unix 11.11. I am trying to compile a Pro *c program. Since the demo_proc.mk has to be used i am trying to customise it but there are many variables defined which i am not able to figure. Can anyone help me out.
say my pro c programs are x1.pc which uses x2.pc
uses sql script x3.sql

what are the variables that i should remove from the demo_proc.mk given in oracle home../proc/demo path
2 REPLIES 2
Indira Aramandla
Honored Contributor

Re: Pro *C

Hi Sandeep,

$ORACLE_HOME/precomp/demo/proc/demo_proc.mk makefile can be used to precompile, compile and link Pro*C application executables. You can customize demo_proc.mk (if you need) to compile/ build Pro*C programs.

For Example:
The command for making myprog executable from myprog.pc is
make -f demo_proc.mk build OBJS="myprog.o" EXE=myprog
You can also give precompiler options using PROCFLAGS
For example:
make -f demo_proc.mk build OBJS="myprog.o" EXE=myprog PROCFLAGS="sqlcheck=semantics userid=scott/tiger"
If you are trying to compile a Pro *c program using the demo_proc.mk, you may use this command to build your custom programs. For example, Your Prog is x1.pc

Copy the sample programs and demo_proc.mk makefile into your working directory.

Enter the following command to build x1.pc:

make -f demo_proc.mk build EXE=x1 OBJS=x1.o

Run the program:
$> x1

Indira A
Never give up, Keep Trying
Werner Ittner
Occasional Advisor

Re: Pro *C

Hi,

for simple C - Programs I just do it this way : (It is for 10g, but I think it is very similar for 9g)

Precompile :
just : proc filename.pc

Compile :
gcc -O -I. -I$ORACLE_HOME/precomp/public \n
-c filename.c

Link :
gcc -o filename.r filename.o \n
-L$ORACLE_HOME/lib -lclnts

Run :
./filename.r


Werner