oracle-databaseoracle-pro-c

ORACLE 10.2 Pro*C precompiler not reading header file


I'm pre-compiling a C program containing Pro*C code with Oracle 10.2 and AIX 5.2

The Oracle precompiler reads the $ORACLE_HOME/precomp/admin/pcscfg.cfg file which contains the definition of the sys_include variable (set to /usr/include).

The Pro*C compiler complains that it doesn't know what the size_t type is and the Oracle header files that use the size_t type are reporting errors.

Here's an example error being reported on the sqlcpr.h file:

extern void sqlglm( char*, size_t*, size_t* );
...........................1
PCC-S-02201, Encountered the symbol "size_t" when expecting one of the following

size_t is defined in the stdio.h header file in the /usr/include directory. I'm including the stdio.h header in my example.pc file before I include the sqlcpr.h header.

I'm issuing the proc command as follows:

proc iname=example parse=full

Any ideas what I'm doing wrong?


Solution

  • From Metalink

    PCC-S-02201, Encountered the symbol "size_t" when expecting one of the 
    following
    :
       ... auto, char, const, double, enum,  float, int, long,
       ulong_varchar, OCIBFileLocator OCIBlobLocator,
       OCIClobLocator, OCIDateTime, OCIExtProcContext, OCIInterval,
       OCIRowid, OCIDate, OCINumber, OCIRaw, OCIString, register,
       short, signed, sql_context, sql_cursor, static, struct,
       union, unsigned, utext, uvarchar, varchar, void, volatile,
       a typedef name, exec oracle, exec oracle begin, exec,
       exec sql, exec sql begin, exec sql type, exec sql var,
    The symbol "enum," was substituted for "size_t" to continue.
    Syntax error at line 88, column 7, file /usr/include/gconv.h:
    Error at line 88, column 7 in file /usr/include/gconv.h
                                      size_t *);
    

    Solution Description

    The 'sys_include' and 'include' precompiler options are not set correctly. Set 'sys_include' and 'include' precompiler options in the pcscfg.cfg file located at $ORACLE_HOME/precomp/admin or include on the command line when invoking 'proc'.

    For example, here is a recommended way to set the variable properly:

    Run the following command to obtain the compiler location:

    gcc -v

    Reading specs from /usr/lib/gcc-lib/i386-redhat-linux7/2.96/specs gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-128)

    Use the path returned above (remove specs and replace with include)

    sys_include=($ORACLE_HOME/precomp/public,
                 /usr/lib/gcc-lib/i386-redhat-linux7/2.96/include, 
                 /usr/include)
    
    include=(/u02/app/oracle/product/8.1.5/precomp/public)
    include=(/u02/app/oracle/product/8.1.5/rdbms/demo)
    include=(/u02/app/oracle/product/8.1.5/network/public)
    include=(/u02/app/oracle/product/8.1.5/plsql/public)
    

    I am guessing that the part of having both sysinclude and include is your issue.