RHEL 8上的Pro*C汇编,包括Math.h的问题
我有一个简单的 C 代码,我试图在安装了 Oracle 19c 客户端的 RHEL 8 计算机上编译它。 程序如下:
#include <stdlib.h>
/* #include <math.h> */
#include <stdio.h>
void main()
{
printf("\nHey!!\n");
}
该代码可以使用 gcc 和 proc(Pro*C 预编译器)命令很好地编译。
但是一旦我取消注释 #include
我正在运行的命令是:
proc iname=test.c oname=test.cp \
include=/usr/lib/gcc/x86_64-redhat-linux/8/include/ \
include=. \
userid=<db connection string> \
sqlcheck=full \
define=ORACLE_PRECOMPILE \
code=ansi_c \
char_map=string \
dbms=v8 \
lines=yes \
ltype=long \
oraca=yes \
parse=full \
select_error=yes \
unsafe_null=yes
报告的语法错误是(仅复制几个错误):
Syntax error at line 62, column 1, file /usr/include/bits/mathcalls.h:
Error at line 62, column 1 in file /usr/include/bits/mathcalls.h
__MATHCALL_VEC (cos,, (_Mdouble_ __x));
1
PCC-S-02201, Encountered the symbol "extern" when expecting one of the following
:
; , = ( [
The symbol ";" was substituted for "extern" to continue.
Syntax error at line 64, column 1, file /usr/include/bits/mathcalls.h:
Error at line 64, column 1 in file /usr/include/bits/mathcalls.h
__MATHCALL_VEC (sin,, (_Mdouble_ __x));
1
PCC-S-02201, Encountered the symbol "extern" when expecting one of the following
:
; , = ( [
The symbol ";" was substituted for "extern" to continue.
当注释 #include
此外,即使包含 math.h,此命令在旧的 RHEL 6 机器上也能正常工作(当然,在将包含路径更改为 RHEL 6 机器的包含目录之后)。
我尝试在互联网上搜索此问题的解决方案,但找不到任何有用的文章。
操作系统版本:
cat os-release
NAME="Red Hat Enterprise Linux"
VERSION="8.4 (Ootpa)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="8.4"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Red Hat Enterprise Linux 8.4 (Ootpa)"
对此的任何帮助都将非常有用。
I've a simple C code which I'm trying to compile on RHEL 8 machine wherein Oracle 19c client is installed.
Here's the program:
#include <stdlib.h>
/* #include <math.h> */
#include <stdio.h>
void main()
{
printf("\nHey!!\n");
}
This code gets compiled well with gcc as well as proc (Pro*C pre-compiler) commands.
But once I uncomment #include <math.h>, a lot of syntax errors are reported when proc command is run.
Command that I'm running is:
proc iname=test.c oname=test.cp \
include=/usr/lib/gcc/x86_64-redhat-linux/8/include/ \
include=. \
userid=<db connection string> \
sqlcheck=full \
define=ORACLE_PRECOMPILE \
code=ansi_c \
char_map=string \
dbms=v8 \
lines=yes \
ltype=long \
oraca=yes \
parse=full \
select_error=yes \
unsafe_null=yes
Syntax errors reported are (copying couple of errors only):
Syntax error at line 62, column 1, file /usr/include/bits/mathcalls.h:
Error at line 62, column 1 in file /usr/include/bits/mathcalls.h
__MATHCALL_VEC (cos,, (_Mdouble_ __x));
1
PCC-S-02201, Encountered the symbol "extern" when expecting one of the following
:
; , = ( [
The symbol ";" was substituted for "extern" to continue.
Syntax error at line 64, column 1, file /usr/include/bits/mathcalls.h:
Error at line 64, column 1 in file /usr/include/bits/mathcalls.h
__MATHCALL_VEC (sin,, (_Mdouble_ __x));
1
PCC-S-02201, Encountered the symbol "extern" when expecting one of the following
:
; , = ( [
The symbol ";" was substituted for "extern" to continue.
This same command works well when #include <math.h> is commented.
Also, this command works fine on old RHEL 6 machine even when math.h is included (of course after changing include path to RHEL 6 machine's include directory).
I tried searching for solution of this problem on internet but couldn't find any helpful article.
OS version:
cat os-release
NAME="Red Hat Enterprise Linux"
VERSION="8.4 (Ootpa)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="8.4"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Red Hat Enterprise Linux 8.4 (Ootpa)"
Any help on this will be very useful.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我遇到了这个问题,只需将
Define=_MATH_H
行添加到位于 $ORACLE_HOME/precomp/admin 目录中的 pcscfg.cfg 中即可解决该问题。
I had the dame issue and simply added the line
define=_MATH_H
to the pcscfg.cfg located in the $ORACLE_HOME/precomp/admin directory which fixed the issue for me.