1

我正在尝试使用以下预编译器选项在 Red Hat Linux v4.1.2-44(能够在 HP 和 Solaris 上编译)上编译 .pc 文件:

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

问题是,只要 EXEC SQL DECLARE SECTION 中有宏或 typedef 数据类型,它就会抛出错误,提示 PCC-S-02322,找到未定义宏标识符,并在typedef 数据类型的情况下抛出以下错误:

PCC-S-02201,在预期以下情况之一时遇到符号“SHORT”:

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, typedef 名称, 预编译头文件, exec oracle, exec oracle begin, exec, exec sql, exec sql begin, exec sql end, exec sql type, exec sql var, exec sql include,

符号“enum”被替换为“SHORT”以继续。

请建议。谢谢

4

1 回答 1

0

您可以先使用 c 预编译器预编译您的源代码:

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

然后你会得到宏解包。

-P 选项是必需的,因为 Pro*C 是可能与线标记混淆的程序。

-E 选项是必需的,因为 Pro*C 是可能与非传统输出混淆的程序。

于 2022-02-22T13:16:16.910 回答