Ora*C PCC-S-02201,遇到符号“L”当预期出现以下情况之一时:
使用 cygwin 配置 pcscfg.cfg 文件在 Windows 中运行 Pro*C 时出现此问题,
Syntax error at line 104, column 31, file C:\cygwin\usr\include\machine/_default_types.h:
Error at line 104, column 31 in file C:\cygwin\usr\include\machine/_default_types.h
#elif defined(LLONG_MAX) && (LLONG_MAX > 0x7fffffff)
..............................1
PCC-S-02201, Encountered the symbol "L" when expecting one of the following:
如下所示:
sys_include=
(C:\cygwin\usr\include,C:\Oracle\product\10.2.0\client_1\precomp\public,C:\cygwin\usr\include\sys,C:\cygwin\lib\gcc\i686-pc-cygwin\4.5.3\include)
ltype=short
define=(ORASTDARG)
code=kr_c
parse=partial
谢谢!
Having this issue when running Pro*C in windows with cygwin
Syntax error at line 104, column 31, file C:\cygwin\usr\include\machine/_default_types.h:
Error at line 104, column 31 in file C:\cygwin\usr\include\machine/_default_types.h
#elif defined(LLONG_MAX) && (LLONG_MAX > 0x7fffffff)
..............................1
PCC-S-02201, Encountered the symbol "L" when expecting one of the following:
config pcscfg.cfg file looks like this:
sys_include=
(C:\cygwin\usr\include,C:\Oracle\product\10.2.0\client_1\precomp\public,C:\cygwin\usr\include\sys,C:\cygwin\lib\gcc\i686-pc-cygwin\4.5.3\include)
ltype=short
define=(ORASTDARG)
code=kr_c
parse=partial
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
考虑使用
来抑制包含邪恶事物的包含,
作为一个可能的解决方法。
它有效地隐藏了 Pro*c 预处理器的包含内容,同时让它存在于编译器中。
您还可以对 metalink 进行一些研究。
Consider using
to suppress the include that is including the evil thing,
as a possible workaround.
It effectively hides the include from the Pro*c preprocessor, while letting it be there for the compiler.
You could also do some research on metalink.
警告:猜测如下。
它所抱怨的代码,文件
_default_types.h
中的第 104 行,第 31 列,是:LLONG_MAX
定义于 <代码>指的是:
类型
long long
和long long
整型常量的LL
后缀是一项新功能在C99中。在 C99 之前的 C 中(除非作为扩展支持),9223372036854775807LL
将是语法错误。我可以想象解析器可能会将其解释为语法上有效的常量9223372036854775807L
后跟L
。 (这实际上不是一个正确的解释,但无论如何它都是一个语法错误。)我没有使用过 Ora*C,但我的猜测是它必须解析其输入代码,这是 C 和 SQL 的组合,产生纯C输出。 (这是正确的吗?)如果 Ora*C 解析器不理解类型
long long
或...LL
文字,它可能会产生这种错误你看到了。真正引起我怀疑的是
pcscfg.cfg
文件中的这一行:这可能告诉 Ora*C 将其输入视为 K&R 风格(即预标准)C 代码。请查阅您的文档,看看是否有一个选项可以让它处理 C99 代码,或者至少是比 K&R C 更现代的代码。
此网页表明
code=ansi_c
是一个可识别的选项。尝试一下。或者错误是否来自 Ora*C 调用的 C 编译器?你用什么C编译器?如果不是gcc,可以配置它使用gcc吗?
Warning: Speculation follows.
The code it's complaining about, line 104, column 31 in file
_default_types.h
, is:LLONG_MAX
is defined in<limits.h>
. On Cygwin, the definition is:which refers to this:
The type
long long
and theLL
suffix forlong long
integer constants are a new feature in C99. In C prior to C99 (unless it's supported as an extension),9223372036854775807LL
would be a syntax error. I can imagine that a parser might interpret it as the syntactically valid constant9223372036854775807L
followed byL
. (That wouldn't actually be a correct interpretation, but it's a syntax error anyway.)I haven't used Ora*C, but my guess is that it has to parse its input code, which is a combination of C and SQL, producing pure C output. (Is that correct?) If the Ora*C parser doesn't understand the type
long long
, or a...LL
literal, it could produce the kind of error you're seeing.Something that really raises my suspicions is this line in your
pcscfg.cfg
file:That probably tells Ora*C to treat its input as K&R style (i.e., pre-standard) C code. Consult your documentation and see if there's an option to tell it to process C99 code, or at least something more modern than K&R C.
This web page suggests that
code=ansi_c
is a recognized option. Try that.Or is the error coming from the C compiler that's invoked by Ora*C? What C compiler are you using? If it's not gcc, can you configure it to use gcc?