1、proc编译器配置问题

在使用proc将.pc文件编译成.c文件时出现一堆的错误,网上的答案七杂八杂的,都没有解决我的问题。

如下是我在使用过程中的一些错误:

由于我可能比较笨,实在是受不了网上那些奇奇怪怪的答案,所以只能乖乖的自己去琢磨,根据错误来看,应该是跟头文件有关

所以我查询了下proc编译器的配置文件,如下

PS:这个是我后面改回来的,反正差不多就是这样。。。。

然后我一开始想是不是这里面涉及到的gcc版本跟我的系统上的不一样,然后就直接去一个一个进去看,例如cd /usr/lib/gcc-lib/x86_64-redhat-linux/3.4.3/include

得出的结果是未找到这个文件,因为我的CentOS的gcc有两个版本(不是特别懂)就是有一个4.8.2和4.8.5的文件夹,其中刚好有Include文件夹,点开有一堆gcc头文件

所以我就将原本的配置文件的版本参数改成这两个版本参数。

然后,重新编译,成功!如下:

另:这是配置文件的路径:$ORACLE_HOME/precomp/admin/pcscfg.cfg

2、我们成功使用proc xxxx.pc编译成.c文件了,但是却不能编译由C++所写的文件,否则出现以下错误:

[oracle@localhost mytest]$ proc testHello1.pc

Pro*C/C++: Release 11.2.0.1.0 - Production on Sun Apr 1 14:58:27 2018

Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.

System default option values taken from: /data/oraacle/product/11.2.0/db_1/precomp/admin/pcscfg.cfg

Error at line 6, column 9 in file testHello1.pc
#include<iostream>
........1
PCC-S-02015, unable to open include file
Syntax error at line 9, column 7, file testHello1.pc:
Error at line 9, column 7 in file testHello1.pc
using namespace std;
......1
PCC-S-02201, Encountered the symbol "namespace" when expecting one of the follow
ing:

; , = ( [

Syntax error at line 16, column 1, file testHello1.pc:
Error at line 16, column 1 in file testHello1.pc
{
1
PCC-S-02201, Encountered the symbol "{" when expecting one of the following:

; , = ( [
The symbol ";" was substituted for "{" to continue.

Syntax error at line 0, column 0, file testHello1.pc:
Error at line 0, column 0 in file testHello1.pc
PCC-S-02201, Encountered the symbol "<eof>" when expecting one of the following:

; { } ( * & + - ~ ! ^ ++ -- ... auto, break, case, char,
const, continue, default, do, double, enum, extern, float,
for, goto, if, int, long, ulong_varchar, OCIBFileLocator
OCIBlobLocator, OCIClobLocator, OCIDateTime,
OCIExtProcContext, OCIInterval, OCIRowid, OCIDate, OCINumber,
OCIRaw, OCIString, register, return, short, signed, sizeof,
sql_context, sql_cursor, static, struct, switch, typedef,
union, unsigned, utext, uvarchar, varchar, void, volatile,
while, an identifier, a typedef name, a precompiled header,
a quoted string, a numeric constant, exec oracle,
exec oracle begin, exec, exec sql, exec sql begin,
exec sql type, exec sql var, exec sql include,

Error at line 0, column 0 in file testHello1.pc
PCC-F-02102, Fatal error while doing C preprocessing

这是因为预编译工具proc,它是完成Pro*C源程序到纯C程序的转换

proc iname=filename [OptionName1=value1]…[OptionNameN=valueN]

常用编译选项

INAME=path and filename (name of the input file)

ONAME=path and filename (name of the output file)

INCLUDE=path  (头文件所在路径)

--INCLUDE =路径名 或 INCLUDE =(路径名1,路径名2)

PARSE=FULL | PARTIA | NONE (default FULL for C, Others for C++)

CODE=ANSI_C | CPP (default ansi_c)

USERID=username/password

以上是它的常用编译选项,如果要想将.pc转换成.cc的c++源程序要这样:proc iname=test.pc parse=none code=cpp oname=test.cc

然后编译c++源程序时,要使用g++,这应该都知道的,哈哈哈~

PS:我觉得proc的编译挺麻烦的,要编译两次,后面自己写了个脚本方便多了,然后才发现有个makefile这个东西。。。。。。。。。

关于CentOS 7 下的Oracle11g的proc编译器的一些常见问题的更多相关文章

  1. Centos环境下删除Oracle11g客户端文档

    将安装目录删除 [root@Oracle /root]# rm -rf /opt/oracle/ 将/usr/bin下的文件删除[root@Oracle /root]# rm /usr/local/b ...

  2. 基于CentOS与VmwareStation10搭建Oracle11G RAC 64集群环境:2.搭建环境-2.7. 配置资源与参数

    2.7.配置资源与参数 2.7.1. 修改主机名称 [root@linuxrac1 ~]# cd /etc/sysconfig [root@linuxrac1 sysconfig]# vi netwo ...

  3. 基于CentOS与VmwareStation10搭建Oracle11G RAC 64集群环境:2.搭建环境-2.6. 安装Oracle所依赖的必要包

    2.6. 安装Oracle所依赖的必要包 2.6.1. 检查Oracle所依赖的必要rpm包 [root@localhost /]#rpm -q binutils compat-libstdc elf ...

  4. 基于CentOS与VmwareStation10搭建Oracle11G RAC 64集群环境:2.搭建环境-2.5. 配置网络

    2.5. 配置网络 2.5.1. 配置网络 Oracle Rac数据库涉及到公用网络和私有网络,因此要做网络划分和IP地址规划,下表列出了要安装的RAC数据库对应的IP地址.主机名以及网络连接类型: ...

  5. 基于CentOS与VmwareStation10搭建Oracle11G RAC 64集群环境:4.安装Oracle RAC FAQ-4.1.系统界面报错Gnome

    1.错误信息:登录系统后,屏幕弹出几个错误对话框,无菜单.无按钮 GConf error: Failed to contact configuration server; some possible ...

  6. 基于CentOS与VmwareStation10搭建Oracle11G RAC 64集群环境:4.安装Oracle RAC FAQ-4.4.无法图形化安装Grid Infrastructure

    无法图形化安装: [grid@linuxrac1 grid]$ ./runInstaller Starting Oracle Universal Installer... Checking Temp ...

  7. CentOS 7 下安装 LEMP 服务(nginx、MariaDB/MySQL 和 php)

    原文 CentOS 7 下安装 LEMP 服务(nginx.MariaDB/MySQL 和 php) LEMP 组合包是一款日益流行的网站服务组合软件包,在许多生产环境中的核心网站服务上起着强有力的作 ...

  8. CentOS系统下Redis安装和自启动配置的步骤

    相信大家都知道Redis是一个C实现的基于内存.可持久化的键值对数据库,在分布式服务中常作为缓存服务.所以这篇文章将详细介绍在CentOS系统下如何从零开始安装到配置启动服务.有需要的可以参考借鉴. ...

  9. CentOS Linux上安装Oracle11g笔记

    CentOS Linux上安装Oracle11g 到 otn.oracle.com 网站上下载 Linux版的oracle 11g 编辑 /etc/sysctl.conf : kernel.shmal ...

随机推荐

  1. ubuntu搭建discuz论坛

    a.安装mysql database 1.安装mysql服务端 sudo apt-get install mysql-server  (在此过程中要求为mysql的root用户设置一个密码) 2.安装 ...

  2. ZedGraph如何动态的加载曲线

    ZedGraph的在线文档 http://zedgraph.sourceforge.net/documentation/default.html 官网的源代码 http://sourceforge.n ...

  3. BZOJ4887: [Tjoi2017]可乐 矩阵快速幂

    Description 加里敦星球的人们特别喜欢喝可乐.因而,他们的敌对星球研发出了一个可乐机器人,并且 放在了加里敦星球的1号城市上.这个可乐机器人有三种行为:停在原地,去下一个相邻的 城市,自爆. ...

  4. java对象在内存的大小

    前言 一直以来,对java对象大小的概念停留在基础数据类型,比如byte占1字节,int占4字节,long占8字节等,但是一个对象包含的内存空间肯定不只有这些. 假设有类A和B,当new A()或者n ...

  5. python删除所有自定义变量方法--转载

    http://blog.sina.com.cn/s/blog_b2f983a50102yexs.html   当我们在pythonwin中创建多个变量后,通过dir()函数,可以看到所有已创建变量,这 ...

  6. AtCoder square869120 Contest #3 F sushi

    本文版权归ljh2000和博客园共有,欢迎转载,但须保留此声明,并给出原文链接,谢谢合作. 本文作者:ljh2000 作者博客:http://www.cnblogs.com/ljh2000-jump/ ...

  7. Codeforces 38B - Chess

    38B - Chess 思路:懂点象棋的规则就可以,看看哪些点可以放马. 代码: #include<bits/stdc++.h> using namespace std; #define ...

  8. Unity游戏中关于伤害范围的计算

    1.纯数学计算 范围计算 + 方向计算: 先将不在伤害范围的敌人排除掉,再计算处于伤害范围并且角度正确的敌人. 以上的计算是以人物的中心来计算的, 所以这中方式就有些局限性了,比如:一个四足怪物,只有 ...

  9. C#复制文件

    string pLocalFilePath ="";//要复制的文件路径 string pSaveFilePath ="";//指定存储的路径 if (File ...

  10. ccfZ字形扫描

    问题描述 在图像编码的算法中,需要将一个给定的方形矩阵进行Z字形扫描(Zigzag Scan).给定一个n×n的矩阵,Z字形扫描的过程如下图所示: 对于下面的4×4的矩阵, 1 5 3 9 3 7 5 ...