📄 ch4_comp.htm
字号:
</table>
</li>
</ol>
<br /><strong><font face="arial, helvetica, sans-serif">Building 32-Bit Pro*C and OCI Customer Applications
</font></strong><br />
<p>Oracle9<em>i</em> release 2 (9.2.0.1.0) supports both 32-bit and 64-bit Pro*C and Oracle Call Interface (OCI) customer applications.
</p>
<div align="center">
<br /><table summary="This is a layout table to format a note" title="This is a layout table to format a note" dir="ltr" border="1" width="80%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0"><tbody>
<tr>
<td align="left" colspan="1" rowspan="1">
<p>
<font face="arial, helvetica, sans-serif">
<strong>See Also:</strong>
</font>
</p><code>$ORACLE_HOME/precomp/demo/demo_proc.mk</code> and <code>$ORACLE_HOME/precomp/demo/demo_proc32.mk</code> files for information on building 32-bit Pro*C applications.
<p>See the <code>$ORACLE_HOME/rdbms/demo/demo_rdbms.mk</code> and <code>$ORACLE_HOME/rdbms/demo/demo_rdbms32.mk</code> files for information on building 32-bit Pro*C applications.
</p>
</td>
</tr></tbody>
</table><br />
</div>
<br /><strong><font face="arial, helvetica, sans-serif">32-Bit Executables and Directories (AIX and HP Only)
</font></strong><br />
<p>In Oracle9<em>i</em> release 2 (9.2.0.1.0) for HP and AIX systems, the following directories contain 32-bit executables and libraries:
</p>
<ul>
<li type="disc">
<p><code>$ORACLE_HOME/lib32</code>
</p>
</li>
<li type="disc">
<p><code>$ORACLE_HOME/rdbms/lib32</code>
</p>
</li>
<li type="disc">
<p><code>$ORACLE_HOME/hs/lib32</code>
</p>
</li>
<li type="disc">
<p><code>$ORACLE_HOME/network/lib32</code>
</p>
</li>
<li type="disc">
<p><code>$ORACLE_HOME/precomp/lib32</code>
</p>
</li>
<li type="disc">
<p><code>$ORACLE_HOME/bin</code>
</p>
</li>
</ul>
</div class="sect1"><a id="i33246" name="i33246"></a>
<div class="sect1">
<!--
infolevel=all
infotype=general
--><a id="sthref480" name="sthref480"></a>
<h2>
<font face="arial, helvetica, sans-serif" color="#330099">Pro*C/C++ Precompiler<a id="sthref481" name="sthref481"></a><a id="sthref482" name="sthref482"></a>
</font>
</h2>
<p>Before you use the Pro*C/C++ precompiler, verify that the correct version of the operating system compiler is properly installed.
</p>
<div align="center">
<br /><table summary="This is a layout table to format a tip" title="This is a layout table to format a tip" dir="ltr" border="1" width="80%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0"><tbody>
<tr>
<td align="left" colspan="1" rowspan="1">
<p>
<font face="arial, helvetica, sans-serif">
<strong><strong>See Also</strong>:</strong>
</font>
</p><em>Oracle9i Installation Guide Release 2 (9.2.0.1.0) for UNIX Systems</em> for information on the required compiler versions on each platform, and the <em>Pro*C/C++ Precompiler Programmer's Guide for additional information on the Pro*C/C++ precompiler and interface features.</em>
</td>
</tr></tbody>
</table><br />
</div>
<div class="sect2">
<!--
infolevel=all
infotype=general
--><a id="sthref483" name="sthref483"></a>
<h3>
<font face="arial, helvetica, sans-serif" color="#330099">
Pro*C/C++ Demonstration Programs<a id="sthref484" name="sthref484"></a><a id="sthref485" name="sthref485"></a>
</font>
</h3>
<p>Demonstration programs are provided to show the features of the Pro*C/C++ precompiler. There are three types of demonstration programs: C, C++, and Object programs. Object programs demonstrate the new Oracle9<em>i</em> Object features. All of the demonstration programs are located in the <code>$ORACLE_HOME/precomp/demo/proc</code> directory. By default, all programs are dynamically linked with the client shared library.
</p>
<p>The programs assume that the demonstration tables created by the <code>$ORACLE_HOME/sqlplus/demo/demobld.sql</code> script exist in the SCOTT schema with the password TIGER.
</p>
<p>Use the <code>demo_proc.mk</code> <a id="sthref486" name="sthref486"></a>make file, located in the <code>$ORACLE_HOME/precomp/demo/proc/</code> directory, to create the demonstration programs. For example, to precompile, compile, and link the <code>sample1</code> demonstration program, enter the following command:
</p>
<pre>$ make -f demo_proc.mk sample1
</pre>
<p>To create all of the C demonstration programs for Pro*C/C++, enter:
</p>
<pre>$ make -f demo_proc.mk samples
</pre>
<p>To create all of the C++ demonstration programs for Pro*C/C++, enter:
</p>
<pre>$ make -f demo_proc.mk cppsamples
</pre>
<p>To create all of the Object demonstration programs for Pro*C/C++, enter:
</p>
<pre>$ make -f demo_proc.mk object_samples
</pre>
<p>Some demonstration programs require you to run a SQL script, located in the <code>$ORACLE_HOME/precomp/demo/sql</code> directory. If you do not run the script, a message displays requesting you to run it. To build a demonstration program and run the corresponding SQL script, include the <code>make</code> macro argument <code>RUNSQL=run</code> on the command line. For example, to create the <code>calldemo</code> demonstration program and run the required <code>$ORACLE_HOME/precomp/demo/sql/calldemo.sql</code> script, enter:
</p>
<pre>$ make -f demo_proc.mk calldemo RUNSQL=run
</pre>
<p>To create all of the Object demonstration programs and run all corresponding required SQL scripts, enter:
</p>
<pre>$ make -f demo_proc.mk object_samples RUNSQL=run
</pre>
</div class="sect2">
<div class="sect2">
<!--
infolevel=all
infotype=general
--><a id="sthref487" name="sthref487"></a>
<h3>
<font face="arial, helvetica, sans-serif" color="#330099">
Pro*C/C++ User Program
</font>
</h3>
<p>You can use the <code>$ORACLE_HOME/precomp/demo/proc/demo_proc.mk</code> make file to create user programs. The syntax for creating a program with the <code>demo_proc.mk</code> make file is:
</p>
<pre>$ make -f demo_proc.mk <em>target</em> OBJS="<em>objfile1</em> <em>objfile2</em> ..." EXE=<em>exename</em>
</pre>
<p>In the preceding example:
</p>
<ul>
<li type="disc">
<p><em><code>target</code></em> is the make file target that you want to use
</p>
</li>
<li type="disc">
<p><em><code>objfilen</code></em> is the object file to link the program
</p>
</li>
<li type="disc">
<p><em><code>exename</code></em> is the executable program
</p>
</li>
</ul>
<p>For example, to create the program <code>myprog</code> from the Pro*C/C++ source file <code>myprog.pc</code>, enter one of the following commands, depending on the source and the type of executable you want to create.
</p>
<ul>
<li type="disc">
<p>For C source, dynamically linked with the client shared library, enter:
</p>
<pre>$ make -f demo_proc.mk build OBJS=myprog.o EXE=myprog
</pre>
</li>
<li type="disc">
<p>For C source, statically linked, enter:
</p>
<pre>$ make -f demo_proc.mk build_static OBJS=myprog.o EXE=myprog
</pre>
</li>
<li type="disc">
<p>For C++ source, dynamically linked with the client shared library, enter:
</p>
<pre>$ make -f demo_proc.mk cppbuild OBJS=myprog.o EXE=myprog
</pre>
</li>
<li type="disc">
<p>For C++ source, statically linked, enter:
</p>
<pre>$ make -f demo_proc.mk cppbuild_static OBJS=myprog.o EXE=myprog
</pre>
<br /><table summary="This is a layout table to format a note" title="This is a layout table to format a note" dir="ltr" border="1" width="80%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0"><tbody>
<tr>
<td align="left" colspan="1" rowspan="1">
<p>
<font face="arial, helvetica, sans-serif">
<strong>Note:</strong>
</font>
</p>On AIX, HP, and Solaris 64-bit systems, the <code>demo_proc.mk</code> make file builds 64-bit user programs by default. You can also use the <code>demo_proc32.mk</code> make file to build 32-bit user programs. See the make file for more information on creating 32-bit user programs.
</td>
</tr></tbody>
</table><br />
</li>
</ul>
</div class="sect2">
</div class="sect1"><a id="i36455" name="i36455"></a>
<div class="sect1">
<!--
infolevel=all
infotype=general
--><a id="sthref488" name="sthref488"></a>
<h2>
<font face="arial, helvetica, sans-serif" color="#330099">Pro*COBOL Precompiler<a id="sthref489" name="sthref489"></a><a id="sthref490" name="sthref490"></a> (AIX, HP, Solaris, and Tru64 Only)
</font>
</h2>
<p>There are two versions of Pro*COBOL included with this release. <a href="#g39948">Table 4-4</a> shows the naming conventions for each version.
</p><a id="sthref491" name="sthref491"></a><a id="g39948" name="g39948"></a>
<p><strong><em><font face="arial, helvetica, sans-serif">Table 4-4 Pro*COBOL Naming Conventions <a id="sthref492" name="sthref492"></a>
</font></em></strong></p>
<table title="Pro COBOL Naming Conventions " summary="This table lists the Pro*COBOL naming differences." dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
<thead>
<tr align="left" valign="top">
<th id="r1c1" align="left" colspan="1" rowspan="1" valign="bottom">
<font face="Arial, Helvetica, sans-serif">
<strong>Item
</strong></font></th>
<th id="r1c2" align="left" colspan="1" rowspan="1" valign="bottom">
<font face="Arial, Helvetica, sans-serif">
<strong>Pro*COBOL Release 9.2.0.1.0
</strong></font></th>
<th id="r1c3" align="left" colspan="1" rowspan="1" valign="bottom">
<font face="Arial, Helvetica, sans-serif">
<strong>Pro*COBOL Release 1.8.77.0.0
</strong></font></th>
</tr>
</thead><tbody>
<tr align="left" valign="top">
<td id="r2c1" headers="r1c1" align="left" colspan="1" rowspan="1">Executable
</td>
<td headers="r2c1 r1c2" align="left" colspan="1" rowspan="1"><code>procob</code>
</td>
<td headers="r2c1 r1c3" align="left" colspan="1" rowspan="1"><code>procob18</code>
</td>
</tr>
<tr align="left" valign="top">
<td id="r3c1" headers="r1c1" align="left" colspan="1" rowspan="1">Demonstration Directory
</td>
<td headers="r3c1 r1c2" align="left" colspan="1" rowspan="1"><code>procob2</code>
</td>
<td headers="r3c1 r1c3" align="left" colspan="1" rowspan="1"><code>procob</code>
</td>
</tr>
<tr align="left" valign="top">
<td id="r4c1" headers="r1c1" align="left" colspan="1" rowspan="1">Make file for Merant Server Express COBOL
</td>
<td headers="r4c1 r1c2" align="left" colspan="1" rowspan="1"><code>demo_procob.mk</code>
</td>
<td headers="r4c1 r1c3" align="left" colspan="1" rowspan="1"><code>demo_procob18.mk</code>
</td>
</tr></tbody>
</table>
<p>Pro*COBOL supports statically linked, dynamically linked, or dynamically loadable programs. Dynamically linked programs use the client shared library. Dynamically loadable programs use the <code>rtsora</code> executable located in the <code>$ORACLE_HOME/bin</code> directory.
</p>
<div class="sect2">
<!--
infolevel=all
infotype=general
--><a id="sthref493" name="sthref493"></a>
<h3>
<font face="arial, helvetica, sans-serif" color="#330099">
<a id="i32437" name="i32437"></a><code></code>Pro*COBOL Environment Variables
</font>
</h3>
<p>This section describes the environment variables required by Pro*COBOL.
</p>
<div class="sect3">
<!--
infolevel=all
infotype=general
--><a id="sthref494" name="sthref494"></a>
<h4>
<font face="arial, helvetica, sans-serif" color="#330099">
Merant Server Express COBOL Compiler<a id="sthref495" name="sthref495"></a><a id="sthref496" name="sthref496"></a><a id="sthref497" name="sthref497"></a>
</font>
</h4>
<p>For the Merant Server Express COBOL compiler, you must set the COBDIR environment variable and the LD_LIBRARY_PATH, LIBPATH, or SHLIB_PATH environment variable, depending on your operating system.
</p>
<br /><strong><font face="arial, helvetica, sans-serif">COBDIR
</font></strong><br />
<p>Set the COBDIR environment variable to the directory where the compiler is installed. For example, if the compiler is installed in the <code>/opt/cobol</code> directory, enter:
</p>
<pre>$ COBDIR=${COBDIR}:$/opt/cobol
$ export COBDIR
</pre>
<br /><strong><font face="arial, helvetica, sans-serif">LD_LIBRARY_PATH (Solaris and HP with 64-Bit Applications Only)
</font></strong><br />
<p>Set the LD_LIBRARY_PATH environment variable to the directory where the compiler is installed. For example, if the compiler is installed in the <code>$COBDIR/coblib</code> directory, enter:
</p>
<pre>$ LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$COBDIR/coblib
$ export LD_LIBRARY_PATH
</pre>
<br /><strong><font face="arial, helvetica, sans-serif">LIBPATH (AIX only)
</font></strong><br />
<p>Set the LIBPATH environment variable to the directory where the compiler is installed. For example, if the compiler is installed in the $COBDIR/coblib directory, enter:
</p>
<pre><code>$ LIBPATH=${LIBPATH}</code>:$COBDIR/coblib
$ export<code> LIBPATH</code>
</pre><a id="CHDFCFDJ" name="CHDFCFDJ"></a>
<br /><strong><font face="arial, helvetica, sans-serif">SHLIB_PATH (HP with 32-Bit Applications)
</font></strong><br />
<p>Set the SHLIB_PATH environment variable to the directory where the compiler is installed. For example, if the compiler is installed in the $COBDIR/coblib directory, enter:
</p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -