Redhat6.4 x86_64 下面oracle11g pro*c 编译产生如下错误
"Syntax error at line 73, column 26, file
/usr/include/gconv.h:
Error at line 73, column 26 in file /usr/include/gconv.h
unsigned char **, size_t *, int, int);
.........................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."
include的目录均设置正确
setting the compilation option PARSE=PARTIAL instead of
PARSE=FULL后,编译通过
解析能力。proc的PARSE选项可以是下面的值:
PARSE=NONE. C预处理指令只能在声明节中被解析,所以所有的宿主变量需要在声明节中声明。
PARSE=PARTIAL. C预处理指令能被解析;然而,所有的宿主变量需要在声明节中声明。
PARSE=FULL.
C预处理指令能被解析,而且宿主变量可以声明在任何地方。当CODE不为CPP时,这是默认设置;但当CODE=CPP时,指定PARSE=FULL却是个错误。
所以,C++用户必须指定PARSE=NONE或PARSE=PARTIAL,因此这也失去了在任意地方声明宿主变量的自由。更有,宿主变量必须被包在一个声明节中,如下:
EXEC SQL BEGIN DECLARE SECTION;
//
declarations...
EXEC SQL END DECLARE SECTION;
你需要使用这种方法去声明所有的宿主和指示器变量。