【发布时间】:2022-06-11 16:44:55
【问题描述】:
我有一个简单的 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)"
对此的任何帮助都会非常有用。
【问题讨论】:
-
您可以edit您的问题添加该信息。
-
显然头文件“math.h”包含“proc”无法理解的代码。进一步调查。
-
这似乎是在 RHEL 8 上使用 Pro*C 的known issue。(注意:似乎需要订阅 Oracle 支持才能访问该链接后面的详细信息。)
-
哎呀。一年多了,Oracle 还是不支持 RHEL 8?!?! RHEL 8 大约在三年前发布。
-
谢谢约翰。您提到的链接中提到了 4 种解决方案,我尝试了一种我认为侵入性最小的解决方案并且它有效。
标签: c oracle oracle-pro-c rhel8