How to compile ProC

How to compile the supplied examples (useful test)
>cd $ORACLE_HOME/precomp/demo/proc
>make -f demo_proc.mk sample1
>./sample1

 

How to compile your code
Suppose you have a file 'prova.pc' containing the code Execute a database procedure
Copy /opt/oracle9/home9i/precomp/demo/proc/demo_proc.mk to
your_directory/prova.mk

Add 'prova' to the 'SAMPLES' key in prova.mk, example:
SAMPLES=sample1 sample2 sample3 sample4 sample6 sample7 sample8 \
sample9 sample10 sample11 sample12 oraca sqlvcp cv_demo \
ansidyn1 ansidyn2 cpdemo1 cpdemo2 scdemo1 scdemo2 prova

>make -f prova.mk prova
>./prova

Errors

Error at line 34, column 11 in file /usr/include/stdio.h
# include <stddef.h>
..........1
PCC-S-02015, unable to open include file

If this happen refer to note 74896.1, here is the workaround:
[oracle9@lx oracle9]$ locate stddef.h
warning: locate: warning: database /var/lib/slocate/slocate.db' is more than 8
days old
/usr/include/linux/stddef.h
/usr/lib/gcc-lib/i386-redhat-linux/3.2.3/include/stddef.h
/usr/lib/gcc-lib/i386-redhat-linux7/2.96/include/stddef.h
...
>vi $ORACLE_HOME/precomp/admin/pcscfg.cfg
Add the first path found with the 'locate' to the search path of 'sys_include' key,
and remove paths not present:
from: sys_include=(
/usr/include,/usr/lib/gcc-lib/i486-suse-linux/2.95.3/include,/usr/lib/gcc-lib/i386-redhat-linux/2.96/include
)
to: sys_include=(/usr/include,/usr/include/linux)

 

Syntax error at line 72, column 26, file /usr/include/gconv.h:
Error at line 72, column 26 in file /usr/include/gconv.h
unsigned char **, size_t *, int, int);
.........................1
PCC-S-02201, Encountered the symbol "size_t" when expecting one of the
following
:

... auto, char, const, double, enum, float, int, long,
ulong_varchar, OCIBFileLocator OCIBlobLocator,
OCIClobLocator, OCIDateTime, OCIExtProcContext, OCIInterval,
OCIRowid, OCIDate, OCINumber, OCIRaw, OCIString, register,
short, signed, sql_context, sql_cursor, static, struct,
union, unsigned, utext, uvarchar, varchar, void, volatile,
a typedef name, exec oracle, exec oracle begin, exec,
exec sql, exec sql begin, exec sql type, exec sql var,
The symbol "enum," was substituted for "size_t" to continue.

Solution
Be sure to edit $ORACLE_HOME/precomp/admin/pcscfg.cfg as specified above