gpt4 book ai didi

ORACLE 10.2 Pro*C 预编译器不读取头文件

转载 作者:行者123 更新时间:2023-12-04 10:33:12 25 4
gpt4 key购买 nike

我正在使用 Oracle 10.2 和 AIX 5.2 预编译包含 Pro*C 代码的 C 程序

Oracle 预编译器读取 $ORACLE_HOME/precomp/admin/pcscfg.cfg file其中包含 sys_include 变量的定义(设置为 /usr/include )。

Pro*C 编译器提示它不知道 size_t类型是和使用 size_t 的 Oracle 头文件类型是报告错误。

这是在 sqlcpr.h 上报告的示例错误文件:

extern void sqlglm( char*, size_t*, size_t* );
...........................1
PCC-S-02201, Encountered the symbol "size_t" when expecting one of the following
size_tstdio.h 中定义 /usr/include 中的头文件目录。我包括 stdio.h我的 example.pc 中的标题在我包含 sqlcpr.h 之前的文件标题。

我发出 proc 命令如下:
proc iname=example parse=full

任何想法我做错了什么?

最佳答案

来自 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)

我猜测同时具有 sysinclude 和 include 的部分是您的问题。

关于ORACLE 10.2 Pro*C 预编译器不读取头文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/325826/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com