Re: Oracle ProC pre-proc code won't link
Date: 1998/02/10
Message-ID: <34E0BC70.B320A28D_at_fairway.com>#1/1
Clancy wrote:
>
> On my DG-UX system, the oracle Pro*C preprocessor produces calls to an extern
> subroutine called 'sqlcxt' for each 'EXEC SQL...' command imbedded in the C
> code.
>
> The link editor balks about 'sqlcxt' being an unresolved reference, even though
> I compile with the '-L' option with the oracle library directory spec.
> I cannot find any libraries with the sqlcxt subroutine in it, but my system
> admin says the oracle installation is complete...
>
> Anybody have any idea what the deal is?
Most UNIX C link editors are single pass. Resolving symbols that exist in other libraries is a problem because the order is important. You may try linking your executable after changing the order of the included libraries.
I have found that the Oracle libraries specified in the example pro*c makefile (proc.mk) work well. You may try to just include that makefile in your makefile and then use their symbols directly.
If you are using oracle newer than 7.3.3, then just include this line in your makefile:
include $(ORACLE_HOME)/precomp/env_precomp.mk
If you are using oracle older than 7.3.3, then take the following lines from the proc.mk and put them in your makefile (these are in the proc.mk file)
# ----------------------------
# Pro*C libraries for Oracle 7
# ----------------------------
LIBHOME=$(ORACLE_HOME)/lib
LLIBCORE=$(LIBHOME)/libcore.a
LLIBCV6=$(LIBHOME)/libcv6.a
LLIBNLSRTL=$(LIBHOME)/libnlsrtl.a
LLIBORA=$(LIBHOME)/libora.a
LLIBSQLNET=$(LIBHOME)/libsqlnet.a
LIBSQL=/u/oracle7/lib/libsql.a
LIBPLS=$(LIBHOME)/libpls.a
LIBPLSHACK= $(LIBPLS)
OSNTAB=$(LIBHOME)/osntab.o
FORMS30GUILIBS=
OTHERLIBS=`cat /u/oracle7/rdbms/lib/sysliblist`
CORELIBS= $(LLIBCORE) $(LLIBNLSRTL) $(LLIBCV6) $(LLIBCORE)
CLIBS=$(ORACLE_HOME)/lib/olm.o $(OTHERLIBS) $(ORACLE_HOME)/lib/olc.o
NETLIBS=$(OSNTAB) $(LLIBSQLNET)
TTLIBS= $(NETLIBS) $(LLIBORA) $(LLIBSQLNET) $(CORELIBS) $(CLIBS)
PROLDLIBS= $(LIBSQL) $(TTLIBS)
To include these Oracle libraries, your target would include the following line in its dependancies:
-L$(PROLDLIBS) The 'PROLDLIBS' is defined in the env_precomp.mk file, which you included using the above syntax. Or has been cut-and-pasted from the proc.mk file.
Hope this helps!
Jeff
-- Senior Software Engineer Fairway Systems, Inc. jcann_at_fairway.comReceived on Tue Feb 10 1998 - 00:00:00 CET
