Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> How to link for static with Pro*C on Solaris?

How to link for static with Pro*C on Solaris?

From: Robert Seals <rseals_at_fore.com>
Date: Fri, 24 Apr 1998 15:11:17 -0400
Message-ID: <3540E3D5.8819E6F8@fore.com>


Hello oracle people,

After a very long struggle trying to figure out how to compile Pro*C programs (without using the nutty demoproc.mk), I have succeeded with the insane link stage thus:

LIBS = -L$(O)/lib/ -L$(O)/rdbms/lib -lclntsh $(O)/lib/nautab.o \ $(O)/lib/naeet.o $(O)/lib/naect.o $(O)/lib/naedhs.o -lnetv2 -lnttcp \
-lnetwork -lncr -lnetv2 -lnttcp -lnetwork -lclient -lvsn -lcommon \
-lgeneric -lmm -lnlsrtl3 -lcore4 -lnlsrtl3 -lcore4 -lnlsrtl3 -lnetv2 \
-lnttcp -lnetwork -lncr -lnetv2 -lnttcp -lnetwork -lclient -lvsn \
-lcommon -lgeneric -lepc -lnlsrtl3 -lcore4 -lnlsrtl3 -lcore4 \
-lnlsrtl3 -lclient -lvsn -lcommon -lgeneric -lnlsrtl3 -lcore4 \
-lnlsrtl3 -lcore4 -lnlsrtl3 -lnsl -lsocket -lgen -ldl -lm -lthread

and $(O) is $ORACLE_HOME. Notice that libnlsrtl3 is mentioned 9 times!

Anyway, this is with gcc on a Solaris 2.6 box, and executables are just wonderful, but they are dynamically linked. It would be very nice indeed if I could make a static executable, even if it is enormous, just so users won't get confused about the message:

ld.so.1: query-or: fatal: libclntsh.so.1.0: open failed: No such file or directory
Killed

when $ORACLE_HOME/lib isn't in their LD_LIBRARY_PATH, or if $ORACLE_HOME isn't set. Does anyone know the magin incantation to do this? I tried just adding -static to the final link, but I get linker errors in that case.

Thanks, I hope!

Robert Received on Fri Apr 24 1998 - 14:11:17 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US