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

From: Maxim Demenko <mdemenko_at_gmail.com>
Date: Sun, 06 Sep 2009 11:56:38 +0200
Message-ID: <4AA38756.5090900_at_gmail.com>



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 Received on Sun Sep 06 2009 - 04:56:38 CDT

Original text of this message