This content has been marked as final. Show 3 replies
Is the library you're talking about named libclntsh.dylib.9.0, right?
I haven't had much experience with compiling on OS X. Indeed, I haven't tried to link with Objective C but I have done compiled an Apache module for PL/SQL access. It's a cousin to the MOD_PLSQL module that usually ships with the database but not in the developers' release. Sorry, I'm digressing.
Here is my Makefile. I do not statically include any Oracle stuff. It then becomes a link-at-runtime issue that is dealt with by setting the necessary environment variables.
Does this help?
all: mod_owarepl.so zlib/zlib.a
rm *.o zlib/*.a zlib/*.o
OBJS = wrb.o utils.o startup.o heap.o \
logon.o timing.o postqury.o \
selinto.o ldimage.o cgienv.o \
ociblock.o ocidesc.o owai.o \
owassi.o getpage.o ssiblk.o \
DBINCL = $(ORACLE_HOME)/rdbms/demo
(cd zlib; make -f Makefile.UNX)
mod_owarepl.so: $(OBJS) mod_owarepl.o zlib/zlib.a owarepl.h
cc -bundle -undefined suppress -flat_namespace -o $@ $(OBJS) mod_owarepl.o zlib/zlib.a \
-L$(ORACLE_HOME)/lib -L/Users/oracle/9iR2/orahome/rdbms/lib \
chmod +x mod_owarepl.so
CFLAGS= -O2 -fPIC -fno-common -DEAPI -DSHARED_MODULE -DDARWIN -I. -I$(DBINCL) -I$(APACHE) -Wall -DERROR_BROKEN
$(ECHODO) $(CC) -c $(INCLUDE) $(CFLAGS) $<
Thank you for your answer.
Is the library you're talking about named libclntsh.dylib.9.0, right?Yes, it is this one. I worked on the issue after posting my message. Actually Apple ProjectBuilder (the July 2002 Jaguar-compatible edition) compiles properly OCI routines together with Objective C code, and builds the executable linked to that dynamic library. One needs to initialize the proper search paths for header files ans libraries, and to add the linker flags "-lclntsh -lm". This is finally equivalent from my (or your) usual UNIX development environment (I could have guessed earlier...).
Finally the compiled executable runs properly when launched from a BASH shell, with ORACLE environment variables set ( everything is well explained in the ORACLE 9i Release Notes for Mac OS X Part No. B10046-01 ). We get the best of both worlds: ORACLE in the Mac windowing system, and I am gearing up to develop a prototype using this release.
Thank you again for your help and your patience.