免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3450 | 回复: 7
打印 上一主题 下一主题

请教一个proc/c++编译的问题! [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-07-03 10:30 |只看该作者 |倒序浏览
我安装了oracle9.2.0.4,操作系统是Linux
我编译我的程序结果报告错误如下:
[ocrm@localhost src]$ make ifsjp02
proc iname=ifsjp02.pc  include=/home/ocrm/include

Pro*C/C++: Release 9.2.0.4.0 - Production on Tue Jul 3 10:30:15 2007

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

System default option values taken from: /home/oracle/product/9.2.0/precomp/admin/pcscfg.cfg

Error at line 34, column 11 in file /usr/include/stdio.h
# include <stddef.h>
..........1
PCC-S-02015, unable to open include file
Error at line 31, column 10 in file /usr/include/bits/types.h
#include <stddef.h>
.........1
PCC-S-02015, unable to open include file
Error at line 14, column 10 in file /usr/include/_G_config.h
#include <stddef.h>
.........1
PCC-S-02015, unable

俺不知道是什么错误,上网找资料也找不到,只好求助各位版主帮忙解答了。谢谢!
我的Oracle的pcscfg.cfg文件配置如下:
sys_include=(/usr/include,/usr/lib/gcc-lib/i486-suse-linux/2.95.3/include,/usr/lib/gcc-lib/i386-redhat-linux/2.96/include)
ltype=short
include=/home/oracle/product/9.2.0/precomp/public
include=/home/oracle/product/9.2.0/rdbms/public
include=/home/oracle/product/9.2.0/rdbms/demo
include=/home/oracle/product/9.2.0/plsql/public
include=/home/oracle/product/9.2.0/network/public
define=(WIN32_LEAN_AND_MEAN)
parse=full
请各位朋友帮忙指教!

论坛徽章:
0
2 [报告]
发表于 2007-07-03 10:43 |只看该作者
有谁帮帮俺,谢谢了!

论坛徽章:
0
3 [报告]
发表于 2007-07-03 11:11 |只看该作者
oracle的开发版本和你的使用版本不一致造成的,你试试proc parse=none参数编译吧,不过这个参数只对declare begin啥的那种有效,写程序不舒服

论坛徽章:
0
4 [报告]
发表于 2007-07-03 11:59 |只看该作者
原帖由 zhangych 于 2007-7-3 11:11 发表
oracle的开发版本和你的使用版本不一致造成的,你试试proc parse=none参数编译吧,不过这个参数只对declare begin啥的那种有效,写程序不舒服


我按照你的要求修改了pcscfg.cfg文件,把 parse=none添加上了,预编译倒是不报告错误但是,CC的时候还是出现错误了,错误提示如下:
[ocrm@localhost src]$ make test
proc iname=test.pc  include=/home/ocrm/include

Pro*C/C++: Release 9.2.0.4.0 - Production on Tue Jul 3 12:02:11 2007

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

System default option values taken from: /home/oracle/product/9.2.0/precomp/admin/pcscfg.cfg

cc  -c -DDEBUG0 -g -I -I/home/ocrm/include test.c
rm -f test.lis
cc  -o test test.o -DDEBUG0 -g -I -I/home/ocrm/include
test.o(.text+0xe3): In function `main':
/home/ocrm/src/test.c:243: undefined reference to `sqlca'
test.o(.text+0x2bc):/home/ocrm/src/test.c:284: undefined reference to `sqlcxt'
test.o(.text+0x2c5):/home/ocrm/src/test.c:288: undefined reference to `sqlca'
test.o(.text+0x35d):/home/ocrm/src/test.c:310: undefined reference to `sqlca'
test.o(.text+0x46d):/home/ocrm/src/test.c:330: undefined reference to `sqlcxt'
test.o(.text+0x476):/home/ocrm/src/test.c:334: undefined reference to `sqlca'
test.o(.text+0x47f):/home/ocrm/src/test.c:334: undefined reference to `sqlca'
test.o(.text+0x48e):/home/ocrm/src/test.c:336: undefined reference to `sqlca'
collect2: ld returned 1 exit status
make: *** [test] Error 1

请帮忙看看,谢谢了!

论坛徽章:
0
5 [报告]
发表于 2007-07-04 09:46 |只看该作者
查看你sqlca.h定义没,如果定义了,你的库文件全没
ORAINCL = $(ORACLE_HOME)/precomp/public
OCIINCL = $(ORACLE_HOME)/rdbms/demo
OTHINCL = $(ORACLE_HOME)/rdbms/public
NETINCL = $(ORACLE_HOME)/network/public
ORAINCS = -I$(ORAINCL) -I$(OCIINCL) -I$(OTHINCL) -I$(NETINCL)
ORALIBS = -L$(ORACLE_HOME)/lib$(OBJEXT) -lclntsh -lclient9

cc $(ORAINCS) -o test test.o -DDEBUG0 -g -I -I/home/ocrm/include  $(ORALIBS)

论坛徽章:
0
6 [报告]
发表于 2007-07-04 16:08 |只看该作者
原帖由 zhangych 于 2007-7-4 09:46 发表
查看你sqlca.h定义没,如果定义了,你的库文件全没
ORAINCL = $(ORACLE_HOME)/precomp/public
OCIINCL = $(ORACLE_HOME)/rdbms/demo
OTHINCL = $(ORACLE_HOME)/rdbms/public
NETINCL = $(ORACLE_HOME)/netw ...


谢谢,我现在已经解决了该问题,但是我想问您$(OBJEXT) 是指的什么lib文件?
麻烦了!

论坛徽章:
0
7 [报告]
发表于 2007-07-05 10:12 |只看该作者
我把在HP-UX系统下的程序移植到linux系统下,结果编译报告错误,数据库版本都是oracle9.2.0.4,请高手帮忙指点。谢谢!
[ocrm@localhost libsrc]$ make all
cc  -c -DDEBUG0 -g -I/home/ocrm/include -I/home/oracle/product/9.2.0/precomp/public -L/home/oracle/product/9.2.0/lib/ -lclntsh `cat /home/oracle/product/9.2.0/lib/ldflags`   `cat /home/oracle/product/9.2.0/lib/sysliblist` -ldl -lm   -L/home/ocrm/lib -lifsfunc -lifsbase  ifsbase.c
ifsbase.c: In function `InsLog':
ifsbase.c:268: parse error before `struct'
ifsbase.c:301: `defoutflag' undeclared (first use in this function)
ifsbase.c:301: (Each undeclared identifier is reported only once
ifsbase.c:301: for each function it appears in.)
ifsbase.c:325: `rc' undeclared (first use in this function)
ifsbase.c:325: `sgbuf' undeclared (first use in this function)
ifsbase.c:362: case label not within a switch statement
ifsbase.c:364: break statement not within loop or switch
ifsbase.c:365: case label not within a switch statement
ifsbase.c:367: break statement not within loop or switch
ifsbase.c:368: case label not within a switch statement
ifsbase.c:372: break statement not within loop or switch
make: *** [ifsbase.o] Error 1

论坛徽章:
0
8 [报告]
发表于 2007-07-05 14:23 |只看该作者
可能是ifsbase.c的程序了,你倒是把InsLog贴出来啊,这么看能看啥啊
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP