4 Replies Latest reply on Jun 27, 2011 2:26 AM by 859327

    Pro*C compiler failing due to incorrect pcscfg.cfg. how do i setup correct

    859327
      this is my code in C Proc

      #include <stdio.h>
      #include <string.h>
      #include <sqlda.h>
      #include <sqlcpr.h>


      EXEC SQL BEGIN DECLARE SECTION;
      VARCHAR uid[30];
      VARCHAR pwd[30];
      EXEC SQL END DECLARE SECTION;

      EXEC SQL INCLUDE SQLCA.H;

      void main()
      {

      strcpy(uid.arr,"test");
      uid.len =strlen(uid.arr);
      strcpy(pwd.arr,"test");
      pwd.len = strlen(pwd.arr);

      EXEC SQL WHENEVER SQLERROR GOTO errexit;
      EXEC SQL CONNECT :uid IDENTIFIED BY :pwd USING:soabam;

      printf("Connected to Oracle8i using soademo/soademo\n");

      EXEC SQL COMMIT WORK RELEASE;
      return;

      errexit:
      printf("Connection failed");
      return;


      } /* end of main */


      locate stddef.h
      /usr/include/linux/stddef.h
      /usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/include/stddef.h
      /usr/lib/syslinux/com32/include/stddef.h
      /usr/lib/syslinux/com32/include/bitsize/stddef.h
      /usr/src/linux-headers-2.6.38-8/include/linux/stddef.h
      /usr/src/linux-headers-2.6.38-8-generic/include/linux/stddef.h

      this is my pcscfg.cfg file look like and i am using Oracle XE in Ubuntu.
      sys_include=(/usr/include,/usr/include/linux,/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/include)
      ltype=short

      when i give the command proc Sample.PC
      i get the following error.



      Pro*C/C++: Release 10.2.0.1.0 - Production on Sat Jun 25 22:53:45 2011

      Copyright (c) 1982, 2005, Oracle. All rights reserved.

      System default option values taken from: /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/precomp/admin/pcscfg.cfg

      Error at line 53, column 11 in file /usr/include/libio.h
      # include <stdarg.h>
      ..........1
      PCC-S-02015, unable to open include file
      Syntax error at line 332, column 3, file /usr/include/libio.h:
      Error at line 332, column 3 in file /usr/include/libio.h
      size_t __pad5;
      ..1
      PCC-S-02201, Encountered the symbol "size_t" when expecting one of the following
      :

      } char, const, double, enum, float, int, long, ulong_varchar,
      OCIBFileLocator OCIBlobLocator, OCIClobLocator, OCIDateTime,
      OCIExtProcContext, OCIInterval, OCIRowid, OCIDate, OCINumber,
      OCIRaw, OCIString, short, signed, sql_context, sql_cursor,
      struct, union, unsigned, utext, uvarchar, varchar, void,
      volatile, a typedef name,
      The symbol "enum," was substituted for "size_t" to continue.

      Syntax error at line 364, column 62, file /usr/include/libio.h:
      Error at line 364, column 62 in file /usr/include/libio.h
      typedef __ssize_t __io_read_fn (void __cookie, char __buf, size_t __nbytes);
      .............................................................1
      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 373, column 6, file /usr/include/libio.h:
      Error at line 373, column 6 in file /usr/include/libio.h
      size_t __n);
      .....1
      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 416, column 34, file /usr/include/libio.h:
      Error at line 416, column 34 in file /usr/include/libio.h
      extern int __underflow (_IO_FILE *);
      .................................1
      PCC-S-02201, Encountered the symbol "*" when expecting one of the following:

      , )

      Syntax error at line 417, column 30, file /usr/include/libio.h:
      Error at line 417, column 30 in file /usr/include/libio.h
      extern int __uflow (_IO_FILE *);
      .............................1
      PCC-S-02201, Encountered the symbol "*" when expecting one of the following:

      , )

      Syntax error at line 418, column 33, file /usr/include/libio.h:
      Error at line 418, column 33 in file /usr/include/libio.h
      extern int __overflow (_IO_FILE *, int);
      ................................1
      PCC-S-02201, Encountered the symbol "*" when expecting one of the following:

      , )

      Syntax error at line 460, column 31, file /usr/include/libio.h:
      Error at line 460, column 31 in file /usr/include/libio.h
      extern int IOgetc (_IO_FILE *__fp);
      ..............................1
      PCC-S-02201, Encountered the symbol "*" when expecting one of the following:

      , )

      Syntax error at line 461, column 31, file /usr/include/libio.h:
      Error at line 461, column 31 in file /usr/include/libio.h
      extern int IOputc (int __c, IOFILE *__fp);
      ..............................1
      PCC-S-02201, Encountered the symbol "_IO_FILE" when expecting one of the followi
      ng:

      ... 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 "_IO_FILE" to continue.

      Syntax error at line 462, column 31, file /usr/include/libio.h:
      Error at line 462, column 31 in file /usr/include/libio.h
      extern int IOfeof (_IO_FILE *__fp) __THROW;
      ..............................1
      PCC-S-02201, Encountered the symbol "*" when expecting one of the following:

      , )

      Syntax error at line 463, column 33, file /usr/include/libio.h:
      Error at line 463, column 33 in file /usr/include/libio.h
      extern int IOferror (_IO_FILE *__fp) __THROW;
      ................................1
      PCC-S-02201, Encountered the symbol "*" when expecting one of the following:

      , )

      Syntax error at line 465, column 39, file /usr/include/libio.h:
      Error at line 465, column 39 in file /usr/include/libio.h
      extern int IOpeekc_locked (_IO_FILE *__fp);
      ......................................1
      PCC-S-02201, Encountered the symbol "*" when expecting one of the following:

      , )

      Syntax error at line 471, column 37, file /usr/include/libio.h:
      Error at line 471, column 37 in file /usr/include/libio.h
      extern void IOflockfile (_IO_FILE *) __THROW;
      ....................................1
      PCC-S-02201, Encountered the symbol "*" when expecting one of the following:

      , )

      Syntax error at line 472, column 39, file /usr/include/libio.h:
      Error at line 472, column 39 in file /usr/include/libio.h
      extern void IOfunlockfile (_IO_FILE *) __THROW;
      ......................................1
      PCC-S-02201, Encountered the symbol "*" when expecting one of the following:

      , )

      Syntax error at line 473, column 39, file /usr/include/libio.h:
      Error at line 473, column 39 in file /usr/include/libio.h
      extern int IOftrylockfile (_IO_FILE *) __THROW;
      ......................................1
      PCC-S-02201, Encountered the symbol "*" when expecting one of the following:

      , )

      Syntax error at line 490, column 34, file /usr/include/libio.h:
      Error at line 490, column 34 in file /usr/include/libio.h
      extern int IOvfscanf (_IO_FILE * __restrict, const char * __restrict,
      .................................1
      PCC-S-02201, Encountered the symbol "*" when expecting one of the following:

      , )

      Syntax error at line 491, column 4, file /usr/include/libio.h:
      Error at line 491, column 4 in file /usr/include/libio.h
      IOva_list, int *__restrict);
      ...1
      PCC-S-02201, Encountered the symbol "__gnuc_va_list" when expecting one of the f
      ollowing:

      ... 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 "auto," was substituted for "__gnuc_va_list" to continue.

      Syntax error at line 492, column 35, file /usr/include/libio.h:
      Error at line 492, column 35 in file /usr/include/libio.h
      extern int IOvfprintf (_IO_FILE __restrict, const char __restrict,
      ..................................1
      PCC-S-02201, Encountered the symbol "*" when expecting one of the following:

      , )

      Syntax error at line 493, column 5, file /usr/include/libio.h:
      Error at line 493, column 5 in file /usr/include/libio.h
      IOva_list);
      ....1
      PCC-S-02201, Encountered the symbol "__gnuc_va_list" when expecting one of the f
      ollowing:

      ... 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 "auto," was substituted for "__gnuc_va_list" to continue.

      Syntax error at line 494, column 39, file /usr/include/libio.h:
      Error at line 494, column 39 in file /usr/include/libio.h
      extern IOssize_t IOpadn (_IO_FILE *, int, IOssize_t);
      ......................................1
      PCC-S-02201, Encountered the symbol "*" when expecting one of the following:

      , )

      Syntax error at line 495, column 19, file /usr/include/libio.h:
      Error at line 495, column 19 in file /usr/include/libio.h
      extern IOsize_t IOsgetn (_IO_FILE *, void *, IOsize_t);
      ..................1
      PCC-S-02201, Encountered the symbol "_IO_sgetn" when expecting one of the follow
      ing:

      ; , = ( [
      The symbol "=" was substituted for "_IO_sgetn" to continue.

      Syntax error at line 495, column 40, file /usr/include/libio.h:
      Error at line 495, column 40 in file /usr/include/libio.h
      extern IOsize_t IOsgetn (_IO_FILE *, void *, IOsize_t);
      .......................................1
      PCC-S-02201, Encountered the symbol "," when expecting one of the following:

      ( * & + - ~ ! ^ ++ -- ... sizeof, an identifier,
      a quoted string, a numeric constant,

      Error at line 0, column 0 in file Sample.PC
      PCC-F-02102, Fatal error while doing C preprocessing
        • 1. Re: Pro*C compiler failing due to incorrect pcscfg.cfg. how do i setup correct
          Dude!
          It seems you will need to modifiy "sys_include" definition in the pcscfg.cfg file so that the Pro*C compiler finds the standard GNU C header files.

          The following link including Metalink Note 74896.1 should explain more details:
          http://www.orafaq.com/forum/t/55085/0/
          • 2. Re: Pro*C compiler failing due to incorrect pcscfg.cfg. how do i setup correct
            859327
            Even after fixing like above i get

            ~/Projects/CPrograms$ locate libio.h
            /usr/include/libio.h

            my pcscfg.cfg file

            sys_include=($ORACLE_HOME/precomp/public,/usr/include,/usr/include/linux,/usr/lib,/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/include) ltype=short

            Pro*C/C++: Release 10.2.0.1.0 - Production on Sun Jun 26 02:20:30 2011

            Copyright (c) 1982, 2005, Oracle. All rights reserved.

            System default option values taken from: /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/precomp/admin/pcscfg.cfg

            Syntax error at line 332, column 3, file /usr/include/libio.h: Error at line 332, column 3 in file /usr/include/libio.h size_t __pad5; ..1 PCC-S-02201, Encountered the symbol "size_t" when expecting one of the following :

            } char, const, double, enum, float, int, long, ulong_varchar, OCIBFileLocator OCIBlobLocator, OCIClobLocator, OCIDateTime, OCIExtProcContext, OCIInterval, OCIRowid, OCIDate, OCINumber, OCIRaw, OCIString, short, signed, sql_context, sql_cursor, struct, union, unsigned, utext, uvarchar, varchar, void, volatile, a typedef name, The symbol "enum," was substituted for "size_t" to continue.

            Syntax error at line 364, column 62, file /usr/include/libio.h: Error at line 364, column 62 in file /usr/include/libio.h typedef __ssize_t __io_read_fn (void _cookie, char buf, sizet __nbytes); .............................................................1 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 373, column 6, file /usr/include/libio.h: Error at line 373, column 6 in file /usr/include/libio.h size_t __n); .....1 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 416, column 34, file /usr/include/libio.h: Error at line 416, column 34 in file /usr/include/libio.h extern int __underflow (_IO_FILE ); .................................1 PCC-S-02201, Encountered the symbol "" when expecting one of the following:

            , )

            Syntax error at line 417, column 30, file /usr/include/libio.h: Error at line 417, column 30 in file /usr/include/libio.h extern int __uflow (_IO_FILE ); .............................1 PCC-S-02201, Encountered the symbol "" when expecting one of the following:

            , )

            Syntax error at line 418, column 33, file /usr/include/libio.h: Error at line 418, column 33 in file /usr/include/libio.h extern int __overflow (_IO_FILE , int); ................................1 PCC-S-02201, Encountered the symbol "" when expecting one of the following:

            , )

            Syntax error at line 460, column 31, file /usr/include/libio.h: Error at line 460, column 31 in file /usr/include/libio.h extern int IOgetc (_IO_FILE __fp); ..............................1 PCC-S-02201, Encountered the symbol "" when expecting one of the following:

            , )

            Syntax error at line 461, column 31, file /usr/include/libio.h: Error at line 461, column 31 in file /usr/include/libio.h extern int _IO_putc (int __c, _IO_FILE *__fp); ..............................1 PCC-S-02201, Encountered the symbol "_IO_FILE" when expecting one of the followi ng:

            ... 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 "_IO_FILE" to continue.

            Syntax error at line 462, column 31, file /usr/include/libio.h: Error at line 462, column 31 in file /usr/include/libio.h extern int _IO_feof (_IO_FILE *__fp) __THROW; ..............................1 PCC-S-02201, Encountered the symbol "*" when expecting one of the following:

            , )

            Syntax error at line 463, column 33, file /usr/include/libio.h: Error at line 463, column 33 in file /usr/include/libio.h extern int _IO_ferror (_IO_FILE *__fp) __THROW; ................................1 PCC-S-02201, Encountered the symbol "*" when expecting one of the following:

            , )

            Syntax error at line 465, column 39, file /usr/include/libio.h: Error at line 465, column 39 in file /usr/include/libio.h extern int _IO_peekc_locked (_IO_FILE *__fp); ......................................1 PCC-S-02201, Encountered the symbol "*" when expecting one of the following:

            , )

            Syntax error at line 471, column 37, file /usr/include/libio.h: Error at line 471, column 37 in file /usr/include/libio.h extern void _IO_flockfile (_IO_FILE *) __THROW; ....................................1 PCC-S-02201, Encountered the symbol "*" when expecting one of the following:

            , )

            Syntax error at line 472, column 39, file /usr/include/libio.h: Error at line 472, column 39 in file /usr/include/libio.h extern void _IO_funlockfile (_IO_FILE *) __THROW; ......................................1 PCC-S-02201, Encountered the symbol "*" when expecting one of the following:

            , )

            Syntax error at line 473, column 39, file /usr/include/libio.h: Error at line 473, column 39 in file /usr/include/libio.h extern int _IO_ftrylockfile (_IO_FILE *) __THROW; ......................................1 PCC-S-02201, Encountered the symbol "*" when expecting one of the following:

            , )

            Syntax error at line 490, column 34, file /usr/include/libio.h: Error at line 490, column 34 in file /usr/include/libio.h extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict, .................................1 PCC-S-02201, Encountered the symbol "*" when expecting one of the following:

            , )

            Syntax error at line 492, column 35, file /usr/include/libio.h: Error at line 492, column 35 in file /usr/include/libio.h extern int _IO_vfprintf (_IO_FILE *_restrict, const char *_restrict, ..................................1 PCC-S-02201, Encountered the symbol "*" when expecting one of the following:

            , )

            Syntax error at line 494, column 39, file /usr/include/libio.h: Error at line 494, column 39 in file /usr/include/libio.h extern _IO_ssize_t _IO_padn (_IO_FILE *, int, _IO_ssize_t); ......................................1 PCC-S-02201, Encountered the symbol "*" when expecting one of the following:

            , )

            Syntax error at line 495, column 19, file /usr/include/libio.h: Error at line 495, column 19 in file /usr/include/libio.h extern _IO_size_t _IO_sgetn (_IO_FILE *, void *, _IO_size_t); ..................1 PCC-S-02201, Encountered the symbol "_IO_sgetn" when expecting one of the follow ing:

            ; , = ( [ The symbol "=" was substituted for "_IO_sgetn" to continue.

            Syntax error at line 495, column 40, file /usr/include/libio.h: Error at line 495, column 40 in file /usr/include/libio.h extern _IO_size_t _IO_sgetn (_IO_FILE *, void *, _IO_size_t); .......................................1 PCC-S-02201, Encountered the symbol "," when expecting one of the following:

            ( * & + - ~ ! ^ ++ -- ... sizeof, an identifier, a quoted string, a numeric constant,

            Error at line 0, column 0 in file Sample.PC PCC-F-02102, Fatal error while doing C preprocessing

            Edited by: 856324 on Jun 26, 2011 9:20 AM
            • 3. Re: Pro*C compiler failing due to incorrect pcscfg.cfg. how do i setup correct
              Dude!
              Errors PCC-02015 and PCC-02201 point to configuration issues and mean that 'sys_include' and 'include' precompiler options are not set correctly in the pcscfg.cfg file.

              What version of Ubuntu are you using? What architecture are you using x86 or x86_64?

              What is your output of "cpp -v"
              • 4. Re: Pro*C compiler failing due to incorrect pcscfg.cfg. how do i setup correct
                859327
                i changed
                sys_include=($ORACLE_HOME/precomp/public,/usr/include,*/usr/include/linux*,/usr/lib,/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/include) ltype=short
                to
                sys_include=($ORACLE_HOME/precomp/public,/usr/include,/usr/lib,/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/include) ltype=short

                and it worked