Oracle7 Administrator's Reference for UNIX

Contents Index Home Previous Next

Pro*C

Administering Pro*C

Pro*C is upwardly compatible for all Pro*C programs written in C. (Pro*C does not support C++ programs.) Pro*C parses the input files, and must know the include pathname to find all the include files.

Users must change makefiles or scripts that call proc. The proc command line must have each nonstandard include pathname specified. For example:

$ proc iname=xyz.pc include=/home/jones/include
$ cc -I/home/jones/include xyz.c

An alternative approach is to enter the following line in the $ORACLE_HOME/proc/pmscfg.h file:

include=/home/jones/include

The pmsfg.h file has default system-wide command line arguments for proc.

Using Pro*C

The $ORACLE_HOME/precomp/demo/proc directory contains the sample1.pc sample C program. Before running this program, use the demobld.sql file to build a demonstration database, described in Chapter 7,"SQL*Plus".

To precompile, compile, and link the sample C program, enter:

$ make -f $ORACLE_HOME/proc/lib/proc.mk sample1

You can now enter additional employees in the demonstration database.

Building Pro*C Programs

You can build your own Pro*C programs with proc.mk. For example, to precompile, compile, and link the userprog.pc program, enter:

$ make -f $ORACLE_HOME/proc/lib/proc.mk userprog

Note: If your program depends on non-Oracle libraries, you may have to alter proc.mk to include them.


Contents Index Home Previous Next