📄 ch4_comp.htm
字号:
</ul>
<p>For example, to create the program <code>myprog</code>, from the Pro*FORTRAN source file <code>myprog.pfo</code>, enter one of the following commands, depending on the type of executable that you want to create:
</p>
<ul>
<li type="disc">
<p>For an executable dynamically linked with the client shared library, enter:
</p>
<pre>$ make -f demo_profor.mk build FORS=myprog.f EXE=myprog
</pre>
</li>
<li type="disc">
<p>For an executable statically linked, enter:
</p>
<pre>$ make -f demo_profor.mk build_static FORS=myprog.f EXE=myprog
</pre>
</li>
</ul>
</div class="sect2">
</div class="sect1"><a id="i38608" name="i38608"></a>
<div class="sect1">
<!--
infolevel=all
infotype=general
--><a id="sthref516" name="sthref516"></a>
<h2>
<font face="arial, helvetica, sans-serif" color="#330099">SQL*Module for Ada (Solaris 32-Bit and AIX Only)
</font>
</h2>
<p>Before using SQL*Module for Ada, verify that the correct version of the compiler is 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>See Also:</strong>
</font>
</p>Oracle9i Installation Guide Release 2 (9.2.0.1.0) for UNIX Systems for information on the required compiler versions on each platform, and the <em>SQL*Module for Ada Programmer's Guide for additional information on SQL*Module for Ada.</em>
</td>
</tr></tbody>
</table><br />
</div>
<div class="sect2">
<!--
infolevel=all
infotype=general
--><a id="sthref517" name="sthref517"></a>
<h3>
<font face="arial, helvetica, sans-serif" color="#330099">
SQL*Module for Ada Demonstration Programs<a id="sthref518" name="sthref518"></a><a id="sthref519" name="sthref519"></a>
</font>
</h3>
<p>Demonstration programs are provided to show the features of SQL*Module for Ada. All of the demonstration programs are located in the <code>$ORACLE_HOME/precomp/demo/modada</code> directory. By default, all programs are dynamically linked with the client shared library.
</p>
<p>The <code>ch1_drv</code> demonstration program assumes 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>The <code>demcalsp</code> and <code>demohost</code> demonstration programs require that the sample college database exists in the MODTEST schema. You can use the appropriate <code>make</code> command to create the MODTEST schema and load the sample college database.
</p>
<p>To create all of the SQL*Module for Ada demonstration programs, run the necessary SQL scripts to create the MODTEST user, and create the sample college database, enter:
</p>
<pre>$ make -f demo_modada.mk all RUNSQL=run
</pre>
<p>To create a single demonstration program (<code>demohost</code>), and run the necessary SQL scripts to create the MODTEST user, and create the sample college database, enter:
</p>
<pre>$ make -f demo_modada.mk makeuser loaddb demohost RUNSQL=run
</pre>
<p>To create all of the SQL*Module for Ada demonstration programs, without recreating the sample college database, enter:
</p>
<pre>$ make -f demo_modada.mk samples
</pre>
<p>To create a single demonstration program (<code>demohost</code>), without recreating the sample college database, enter:
</p>
<pre>$ make -f demo_modada.mk demohost
</pre>
<p>All programs assume that an Oracle Net connect string or alias named INST1_ALIAS is defined and is capable of connecting to the database where the appropriate tables exist.
</p>
</div class="sect2">
<div class="sect2">
<!--
infolevel=all
infotype=general
--><a id="sthref520" name="sthref520"></a>
<h3>
<font face="arial, helvetica, sans-serif" color="#330099">
SQL*Module for Ada User Programs<a id="sthref521" name="sthref521"></a><a id="sthref522" name="sthref522"></a>
</font>
</h3>
<p>You can use the <code>$ORACLE_HOME/precomp/demo/modada</code>/<code>demo_modada.mk</code> make file to create user programs. The syntax for creating a user program with the <code>demo_modada.mk</code> make file is:
</p>
<pre>$ make -f demo_modada.mk ada OBJS="<em>module1</em> <em>module2</em> ..." \
EXE=<em>exename</em> MODARGS=<em>SQL*Module_arguments</em>
</pre>
<p>In the preceding example:
</p>
<ul>
<li type="disc">
<p><em><code>modulen</code></em> is a compiled Ada object
</p>
</li>
<li type="disc">
<p><em><code>exename</code></em> is the executable program
</p>
</li>
<li type="disc">
<p><em><code>SQL*Module_arguments</code></em> are the command-line arguments to be passed to the SQL*Module
</p>
<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>See Also:</strong>
</font>
</p><em>SQL*Module for Ada Programmers Guide</em> for more information on SQL*Module for Ada user programs.
</td>
</tr></tbody>
</table><br />
</li>
</ul>
</div class="sect2">
</div class="sect1"><a id="i37921" name="i37921"></a>
<div class="sect1">
<!--
infolevel=all
infotype=general
--><a id="sthref523" name="sthref523"></a>
<h2>
<font face="arial, helvetica, sans-serif" color="#330099">Oracle Call Interface <a id="sthref524" name="sthref524"></a>
</font>
</h2>
<p>Before you use the Oracle Call Interface (OCI), verify that the correct version of Pro*C/C++ is 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>See Also:</strong>
</font>
</p>Oracle9i Installation Guide Release 2 (9.2.0.1.0) for UNIX Systems for more information on the required version of Pro*C/C++ for your operating system, and the <em>Oracle Call Interface Programmer's Guide for additional information on the Oracle Call Interface.</em>
</td>
</tr></tbody>
</table><br />
</div>
<div class="sect2">
<!--
infolevel=all
infotype=general
--><a id="sthref525" name="sthref525"></a>
<h3>
<font face="arial, helvetica, sans-serif" color="#330099">
OCI Demonstration Programs<a id="sthref526" name="sthref526"></a><a id="sthref527" name="sthref527"></a>
</font>
</h3>
<p>Demonstration programs are provided that show the features of the OCI. There are two types of demonstration programs: C and C++. All of the demonstration programs are located in the <code>$ORACLE_HOME/rdbms/demo</code> directory. By default, all programs are dynamically linked with the client shared library.
</p>
<p>Many of the demonstration 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_rdbms.mk</code> make file, located in the <code>$ORACLE_HOME/rdbms/demo</code> directory, to create the demonstration programs. For example, to compile and link the <code>cdemo1</code> demonstration program, enter the following command:
</p>
<pre>$ make -f demo_rdbms.mk cdemo1
</pre>
<p>To create all of the C demonstration programs for OCI, enter:
</p>
<pre>$ make -f demo_rdbms.mk demos
</pre>
<p>To create all of the C++ demonstration programs for OCI, enter:
</p>
<pre>$ make -f demo_rdbms.mk c++demos
</pre>
</div class="sect2">
<div class="sect2">
<!--
infolevel=all
infotype=general
--><a id="sthref528" name="sthref528"></a>
<h3>
<font face="arial, helvetica, sans-serif" color="#330099">
OCI User Programs
</font>
</h3>
<p>You can use the <code>$ORACLE_HOME/rdbms/demo</code>/<code>demo_rdbms.mk</code> make file to create user programs. The syntax for creating a user program with the <code>demo_rdbms.mk</code> make file is:
</p>
<pre>$ make -f demo_rdbms.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 <code>myprog</code> program from the C/C++ source <code>myprog.c</code>, enter one of the following commands, depending on 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_rdbms.mk build OBJS=myprog.o EXE=myprog
</pre>
</li>
<li type="disc">
<p>For C source, statically linked, enter:
</p>
<pre>$ make -f demo_rdbms.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_rdbms.mk buildc++ OBJS=myprog.o EXE=myprog
</pre>
</li>
<li type="disc">
<p>For C++ source, statically linked, enter:
</p>
<pre>$ make -f demo_rdbms.mk buildc++_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>In the preceding examples, the file <code>myprog.o</code> is the object file generated by the compiler.
<p>On AIX, HP, and Solaris 64-bit, the <code>demo_rdbms.mk</code> make file builds 64-bit user programs by default. You can use the <code>demo_rdbms32.mk</code> make file to build 32-bit user programs. See the make file for more information on creating 32-bit user programs.
</p>
</td>
</tr></tbody>
</table><br />
</li>
</ul>
</div class="sect2">
</div class="sect1"><a id="i26133" name="i26133"></a>
<div class="sect1">
<!--
infolevel=all
infotype=general
--><a id="sthref529" name="sthref529"></a>
<h2>
<font face="arial, helvetica, sans-serif" color="#330099">Custom Make Files<a id="sthref530" name="sthref530"></a>
</font>
</h2>
<p>Oracle Corporation recommends that you use the provided <code>demo_</code><em><code>product</code></em><code>.mk</code> make files to create user programs as described in the specific product sections of this chapter. If you modify the provided make file, or if you choose to use a custom-written make file, the following restrictions apply:
</p>
<ul>
<li type="disc">
<p>Do not modify the order of the Oracle libraries. Oracle libraries are included on the link line more than once so that all of the symbols are resolved during linking.
</p>
<p>The order of the Oracle libraries is essential for the following reasons:
</p>
<ul>
<li type="circle">
<p>Oracle libraries are mutually referential. Functions in library A call functions in library B, and functions in library B call functions in library A.
</p>
</li>
<li type="circle">
<p>The HP and Tru64 linkers are one-pass linkers. The AIX, Linux, and Solaris linkers are two-pass linkers.
</p>
</li>
</ul>
</li>
<li type="disc">
<p>If you add your own library to the link line, add it to the beginning or to the end of the link line. Do not place user libraries between the Oracle libraries.
</p>
</li>
<li type="disc">
<p>If you choose to use a <code>make</code> utility such as <code>nmake</code> or GNU <code>make</code>, be aware of how macro and suffix processing differs from the make utility provided with the platform. Oracle make files are tested and are supported with the <code>make</code> utility for your platform.
</p>
</li>
<li type="disc">
<p>Oracle library names and the contents of Oracle libraries are subject to change between releases. Always use the <code>demo_</code><em><code>product</code></em><code>.mk</code> make file that ships with the current release as a guide to determine the required libraries.
</p>
</li>
</ul>
</div class="sect1"><a id="i26152" name="i26152"></a>
<div class="sect1">
<!--
infole
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -