Re: Any Pro*C/C++ users out there?

From: Ramon F Herrera <ramon_at_conexus.net>
Date: Sun, 6 Sep 2009 07:04:59 -0700 (PDT)
Message-ID: <574cbfcf-d8f7-4d40-8aed-17c23fe56d5b_at_s31g2000yqs.googlegroups.com>



On Sep 6, 5:56 am, Maxim Demenko <mdeme..._at_gmail.com> wrote:
> Ramon F Herrera wrote:
> > I have been using Pro*C/C++ for a while, but so far all my programs
> > have been written in C. I just started trying to run some C++
> > programs, the ones that come with the precompiler: cppdemo[1-3].pc
>
> > My problem is that I would like to modify the sys_include variable and
> > I can't
>
> > Every time I compile, there is a message:
>
> > System default option values taken from: /home/oracle/product/10.2.0/
> > precomp/admin/pcscfg.cfg
>
> > So, I figure that I need to modify that file. Since my Linux is
> > RedHat, I remove the entry that mentions SuSe. I updated the list of C+
> > + directories.
>
> > Even after those changes the precompiler seems to keep on searching
> > include files in the wrong/old places.
>
> > TIA,
>
> > -Ramon
>
> > ps: The only demo that builds fine is cppdemo2.pc, because it doesn't
> > have an #include <iostream> statement.
>
> > --------------------------------
>
> > Those include directories down here should NOT be there. I removed
> > them from pcscfg.cfg
>
> > proc code=cpp 'sys_include=(/home/oracle/product/10.2.0/precomp/
> > public,/usr/include,/usr/lib/gcc-lib/i486-suse-lin
> > ux/2.95.3/include,/usr/lib/gcc-lib/i386-redhat-linux/3.2.3/include,/
> > usr/lib/gcc-lib/i386-redhat-linux7/2.96/includ
> > e)' iname=cppdemo3
>
> Warning mentioned by you seems to come from
> $ORACLE_HOME/precomp/lib/env_precomp.mk, there is the following
> hardcoded definition of CPLUS_SYS_INCLUDE:
>
> SYS_INCLUDE_PATH=/usr/include,/usr/lib/gcc/i386-redhat-linux/4.1.1/include,/usr/lib/gcc/i386-redhat-linux/3.4.5/include,/usr/l
> ib/gcc-lib/i386-redhat-linux/3.2.3/include,/usr/lib/gcc/i586-suse-linux/4.1.0/include
> SYS_INCLUDE='sys_include=($(ORACLE_HOME)/precomp/public,$(SYS_INCLUDE_PATH))'
> CPLUSPLUS=g++
> CPLUS_SYS_INCLUDE='sys_include=($(ORACLE_HOME)/precomp/public,$(SYS_INCLUDE_PATH))'
>
> Despite the warning, c++ demos seem to compile fine on my system ( 11gR1
> , RedHat 5.3)
>
> Besides that, there is a Metalink Note 108440.1 (the note is about
> precompiler not able to find new style header files without .h
> extensions on sun, but may apply to Linux as well), which essentially
> suggests following workarounds:
> 1) create symbolic links in your local directory to required headers (
> e.g. ln -s /usr/include/c++/4.1.1/iostream iostream.h)
> 2) modify your sample program to enclose all includes into infndef block
> (then the verification of headers will be skipped by precompiler and
> deferred to compilation time, which should be ok)  like:
> #ifndef ORA_PROC
>
> /* include all of the header files with no extension */
> #include <ostream>
> #include <istream>
> #include .....
>
> #endif
>
> I just tried the second workaround and it does indeed eliminated
> precompiler warnings.
>
> Best regards
>
> Maxim

Maxim,

Thanks again for your tips. I fixed the problem and now I can compile the 3 provided samples: cppdemo1.pc, cppdemo2.pc and cppdemo3.pc.

I did not have to create any soft links. All I had to do is carefully edit the following line in TWO files at the same time:

sys_include=(/home/oracle/product/10.2.0/precomp/public,/usr/include,/ usr/lib/gcc-lib/i386-redhat-linux/3.2.3/incl ude,/usr/include/c++/3.2.3/i386-redhat-linux,/usr/include/c++/3.2.3)

The two files in question, which apparently need to be kept synchronized, are:

$ORACLE_HOME/precomp/admin/pcscfg.cfg

$ORACLE_HOME/precomp/lib/env_precomp.mk

I will have more questions and comments about the precompiler, as I claim that it provides the fastest possible access to Oracle, compared with alternatives such as Java or PL/SQL.

-Ramon Received on Sun Sep 06 2009 - 09:04:59 CDT

Original text of this message