proc程序原来在ora8i下编译、执行正常,可升级到9i后,改makefile,再编译,有些就不行了

damadama 2004-02-16 03:03:34
proc程序原来在ora8i下,编译、执行正常,可在oracle升级到9i后,修改makefile中的lib路径后,再编译,是成功的。可是执行时,有的程序可以执行正常,有的不行,它们都要做的第一步就是连接数据库,我用dbx调试后发现是在生成的c代码中连接数据库的时候sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn)这一行出错,程序终止了。
可是pc文件中,所有程序连接数据库的代码都是一样的啊:EXEC SQL CONNECT :username IDENTIFIED BY :password 。我也仔细对比了多个程序根据EXEC SQL CONNECT :username IDENTIFIED BY :password生成的c代码,竟然都有些差异。
这里,想问达人,应该怎么处理:是在makefile中改,还是别的方法。
我把makefile贴在下面,是在一个makefile中同时编译10个程序.




include $(ORACLE_HOME)/precomp/lib/env_precomp.mk

# This Makefile builds the sample programs in
# $(ORACLE_HOME)/precomp/demo/proc, and can serve as a template for linking
# customer applications.
#
# SAMPLES is a list of the c proc sample programs.
# CPPSAMPLES is a list of the c++ proc sample programs.
# OBJECT_SAMPLES is a list of the proc sample programs using the new
# type features. You must install ott in addition to proc to run some
# of those samples.
#

PRODLIBHOME64=$(PRODHOME)lib
CFLAGS64=-q64$(CFLAGS)


SAMPLES= demo1 demo2 demo3 demo4 demo5 demo6 demo7 demo8 demo9 demo10
#CPPSAMPLES=cppdemo1 cppdemo3
#OBJECT_SAMPLES=objdemo1 lobdemo1 coldemo1 navdemo1
#
# These targets are build all of a class of samples in one call to make.
#
samples: $(SAMPLES)
#cppsamples: $(CPPSAMPLES)
#object_samples: $(OBJECT_SAMPLES)
#
# The target 'build' puts together an executable $(EXE) from the .o files
# in $(OBJS) and the libraries in $(PROLDLIBS). It is used to build the
# c sample programs. The rules to make .o files from .c and .pc files are
# later in this file.
# ($(PROLDLIBS) includes the client shared library, and $(STATICPROLDLIBS) does
# not.)
#
samples64:
$(MAKE) -f $(MAKEFILE) samples LIBHOME=$(ORACLE_HOME)/lib/ PRODLIBHOME=$(PRODLIBHOME64) CFLAGS="$(CFLAGS64)" LFLAGS="-q64 -b64"
build: $(OBJS)
$(CC) $(LFLAGS) -o $(EXE) $(OBJS) -L$(LIBHOME) $(PROLDLIBS)
build64:
$(MAKE) -f $(MAKEFILE) build LIBHOME=$(ORACLE_HOME)/lib/ PRDLIBHOME=$(PRODLIBHOME64) RDBMSLIB=$(ORACLE_HOME)/rdbms/lib/ CFLAGS="$(CFLAGS64)" LFLAGS="-q64 -b64"

build_static: $(OBJS)
$(CC) $(LFLAGS) -o $(EXE) $(OBJS) -L$(LIBHOME) $(STATICPROLDLIBS) $(AIXIMP)
build_static64:
$(MAKE) -f $(MAKEFILE) build_static LIBHOME=$(ORACLE_HOME)/lib/ PRODLIBHOME=$(PRODLIBHOME64) RDBMSLIB=$(ORACLE_HOME)/rdbms/lib/ CFLAGS="$(CFLAGS64)" LFLAGS="-q64 -b64"
$(SAMPLES):
$(MAKE) -f $(MAKEFILE) OBJS=$@.o EXE=$@ build LIBHOME="$(LIBHOME)" PRODLIBHOME="$(PRODLIBHOME)" CFLAGS="$(CFLAGS)" LFLAGS="$(LFLAGS)"
#
# Here are some rules for converting .pc -> .c -> .o and for .typ -> .h.
#
# If proc needs to find .h files, it should find the same .h files that the
# c compiler finds. We use a macro named INCLUDE to hadle that. The general
# format of the INCLUDE macro is
# INCLUDE= $(I_SYM)dir1 $(I_SYM)dir2 ...
#
# Normally, I_SYM=-I, for the c compiler. However, we have a special target,
# pc1, which calls $(PROC) with various arguments, include $(INCLUDE). It
# is used like this:
# $(MAKE) -f $(MAKEFILE) <more args to make> I_SYM=include= pc1
# This is used for some of $(SAMPLES) and for $(OBJECT_SAMPLE).
.SUFFIXES: .pc .c .o .typ .h

pc1:
$(PROC) $(PROCFLAGS) iname=$(PCCSRC) $(INCLUDE)

.pc.c:
$(PROC) $(PROCFLAGS) iname=$*

.pc.o:
$(PROC) $(PROCFLAGS) iname=$*
$(CC) $(CFLAGS) -c $*.c

.c.o:
$(CC) $(CFLAGS) -c $*.c

.typ.h:
$(OTT) intype=$*.typ hfile=$*.h outtype=$*o.typ $(OTTFLAGS) code=c user=scott/tiger
#
# The macro definition fill in some details or override some defaults from
# other files.
#
OTTFLAGS=$(PCCFLAGS)
CLIBS= $(TTLIBS_QA) $(LDLIBS)
PRODUCT_LIBHOME=
MAKEFILE=convert1.mk
PROCPLSFLAGS= sqlcheck=full userid=$(USERID)
PROCPPFLAGS= code=cpp $(CPLUS_SYS_INCLUDE)
USERID=scott/tiger
NETWORKHOME=$(ORACLE_HOME)/network/
PLSQLHOME=$(ORACLE_HOME)/plsql/
INCLUDE=$(I_SYM). $(I_SYM)$(PRECOMPHOME)public $(I_SYM)$(RDBMSHOME)public $(I_SYM)$(RDBMSHOME)demo $(I_SYM)$(PLSQLHOME)public $(I_SYM)$(NETWORKHOME)public
...全文
42 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复

17,086

社区成员

发帖
与我相关
我的任务
社区描述
Oracle开发相关技术讨论
社区管理员
  • 开发
  • Lucifer三思而后行
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧