Error in Proc*C compilation

1.9k views Asked by At

I'm trying to compile .pc file on Red Hat Linux v4.1.2-44 (able to compile on HP and Solaris) with following precompiler options:

PROCFLAGS=*maxopencursors*=100 PARSE=NONE userid=db2poc/db2poc@mydb VARCHAR=YES code=CPP CPP_SUFFIX=cpp duration=session sqlcheck=full include=/app1/myuser/Application/Source/Header SYS_INCLUDE=/oradata1/ora11g/app/ora11g/product/11.2.0/dbhome_1/rdbms/public,/oradata1/ora11g/app/ora11g/product/11.2.0/dbhome_1/precomp/public,/oradata1/ora11g/app/ora11g/product/11.2.0/dbhome_1/rdbms/plsql/public,/oradata1/ora11g/app/ora11g/product/11.2.0/dbhome_1/xdk/include,/usr/include/c++/3.4.6/backward

The problem is, wherever there is a macro or typedef data type in EXEC SQL DECLARE SECTION, it throws an error saying PCC-S-02322, found undefined identifier for macros and throws the following error in case of typedef data types:

PCC-S-02201, Encountered the symbol "SHORT" when expecting one of the following:

auto, char, const, double, enum, extern, 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,* typedef, union, unsigned, utext, uvarchar, varchar, void, volatile, a typedef name, a precompiled header, exec oracle, exec oracle begin, exec, exec sql, exec sql begin, exec sql end, exec sql type, exec sql var, exec sql include,

The symbol "enum," was substituted for "SHORT" to continue.

Please suggest. Thanks

1

There are 1 answers

0
Ivan Borsuk On

You may first precompile your source with c precompiler:

cpp -P -E yourfile.src -o yourfile.dst

Then you will get macros unpacked.

-P option is needed because Pro*C is the program which can be confused with linemarkers.

-E option is needed because Pro*C is the program which can be confused with non-traditional output.