Hi,

I am writing a OCI program using Oracle 9 on Sun Solaris. I want to make it as a shared library and use this shared library to make an executable with my c program. I could make the shared library. but I get undefined symbols when make the executable. I am using Sun compiler.

Makefile for shared library is:
# make -f ociucb.mk user_callback SHARED_LIBNAME=libconDBAccess.so
# OBJS=conDBAccess.o
#
CC=cc
NOKPIC_CCFLAGS64= -Xa $(PROFILE) -xstrconst -dalign -xF $(XS) $(MR) \
-xildoff -errtags=yes -v -xarch=v9b -xchip=ultra3 \
-W2,-AKNR_S -Wd,-xsafe=unboundsym \
-Wc,-Qiselect-funcalign=32 -xcode=abs44 \
-Wc,-Qgsched-trace_late=1 -Wc,-Qgsched-T5 \
-D_REENTRANT -DSS_64BIT_SERVER -DBIT64 -DMACHINE64
KPIC_OPTION=-K PIC
CCFLAGS=$(NOKPIC_CCFLAGS64) $(KPIC_OPTION)
I_SYM=-I
PCCI=$(I_SYM)$(ORACLE_HOME)/precomp/public $(I_SYM)$(HOME)/rdbms
INCLUDE= $(I_SYM)$(ORACLE_HOME)/rdbms/demo $(I_SYM)$(ORACLE_HOME)/rdbms/public $(I_SYM)$(ORACLE_HOME)/plsql/public $(I_SYM)$(ORACLE_HOME)/network/public $(I_SYM)/export/home/bhuvana/rdbms
C2O=$(CC) $(CCFLAGS) -c $(INCLUDE) $(PCCI) $<
LD=ld
LIBDIR=lib
SHARED_LDFLAG=-G -z text -L$(ORACLE_HOME)/$(LIBDIR) -L$(HOME)/root/framework/conDatabase/src -R$(ORACLE_HOME)/$(LIBDIR) -o
MYLIBHOME=$(HOME)/root/framework/conDatabase/src/

BUILD_USERCALLBACK=$(LD) $(SHARED_LDFLAG) $(MYLIBHOME)$(SHARED_LIBNAME) $(OBJS)
.SUFFIXES: .o

.c.o:
$(C2O)

user_callback: $(OBJS)
$(BUILD_USERCALLBACK)

Makefile for making the executable is:
## -*- Makefile -*-

INCLUDES =-I/opt/software/xerces-c_2_5_0-solaris_27_64-cc_62/include -I$(HOME)/root/include -I$(HOME)/rdbms

#### Compiler and tool definitions shared by all build targets #####
CC = cc
CCC = CC
CXX = CC
BASICOPTS = -g
CFLAGS = $(BASICOPTS) -xCC
CCFLAGS = $(BASICOPTS) -xarch=v9b -compat=4
CXXFLAGS = $(BASICOPTS) -compat=4
CCADMIN = CCadmin -clean

#LIBNAME=libxerces-c.so.25.0
#SOEXT=.so.25.0
#SOFLAGS=-shared -soname, $(LIBNAME) $(SOEXT) $(LIBPATH)
#LIBPATH=/opt/software/xerces-c_2_5_0-solaris_27_64-cc_62/lib
LIBPATH=$(HOME)/root/framework/conDatabase/src

# Define the target directories.
TARGETDIR=$(HOME)/root/framework/conDatabase/src

testdb: $(TARGETDIR)/testdb

## Target: testdb
OBJS_testdb = \
$(TARGETDIR)/testdb.o

SYSLIBS = -L/usr/openwin/lib -L/usr/dt/lib -L/opt/software/xerces-c_2_5_0-solaris_27_64-cc_62/lib -R/usr/openwin/lib -R/usr/dt/lib -R/opt/software/xerces-c_2_5_0-solaris_27_64-cc_62/lib -lXm -lXt -lXext -lX11 -L/usr/lib -L$(LIBPATH) -L$(ORACLE_HOME)/lib -lclntsh
USERLIBS= $(SYSLIBS) -lconDBAccess
LDLIBS= $(USERLIBS)

$(TARGETDIR)/testdb: $(TARGETDIR) $(OBJS_testdb) $(DEPLIBS)
$(LINK.cc) $(CCFLAGS) $(CPPFLAGS) -o $@ $(OBJS_testdb) $(LDLIBS)

$(TARGETDIR)/testdb.o: $(TARGETDIR) testdb.c
$(COMPILE.cc) $(INCLUDES) $(CCFLAGS) $(CPPFLAGS) -o $@ testdb.c

# Create the target directory (if needed)
$(TARGETDIR):
mkdir -p $(TARGETDIR)

# Enable dependency checking
.KEEP_STATE:
.KEEP_STATE_FILE:.make.state.Sun-sparc-Solaris

I have set the LD_LIBRARY_PATH in my environment variable. Can anyone tell me what is wrong in this?

Thanks,
Bhuvana