1830728 Members
2370 Online
110015 Solutions
New Discussion

link libclntsh dynamic

 
Herbert Simon
Advisor

link libclntsh dynamic

Hi Folks out there!
How to compile a program that the libclntsh.sl on 11.11 is linked as dynamic?
I try:
cc -o vpmadp -Wl,+s vpmadp-main.o vpmadp-vpm_db.o -lpthread /usr/app/oracle/product/8.1.7//lib/libclntsh.sl ../src/liborainf.a

output from chatr is:
shared library list:
dynamic /usr/lib/libpthread.1
static /usr/app/oracle/product/8.1.7//lib/libclntsh.sl
.8.0

?? Which ld flag must be set that the libclntsh is dynamic loadable??

Thanks for help!
6 REPLIES 6
Steve Steel
Honored Contributor

Re: link libclntsh dynamic

Hi


google on genclntsh


get to

http://publib.boulder.ibm.com/infocenter/txen/index.jsp?topic=/com.ibm.txseries510.doc/erzhab0069.htm

Shows how script used to rebuild lib


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Herbert Simon
Advisor

Re: link libclntsh dynamic

Hi Steve!
Thanks for the very fast answer. I'm afraid that I don't describe my problem exactly:
I don't want to relink the libclntsh istself! I link this library to my own programm as a normal library. All works fine but the linker bind the libclntsh as a static library to the resulted binary. This means independent from SHLIB_PATH the dld search the given absolut path in the binary about the libclntsh. This is worse!
I can change the binary with chatr -l [pathname] [binary_name] so the library is searched by the dld and the SHLIB_PATH. But i want to create a binary with this atribute directly on linktime.

Help??
Fred Ruffet
Honored Contributor

Re: link libclntsh dynamic

Hi,

Shouldn't you have -l/usr/app/oracle/product/8.1.7//lib/libclntsh.sl instead of just /usr/app/oracle/product/8.1.7//lib/libclntsh.sl ? (or -L)
And you should add /usr/app/oracle/product/8.1.7/lib to your LD_LIBRARY_PATH, in order to have ld find libs in it.

Regards,

Fred
--

"Reality is just a point of view." (P. K. D.)
Stephen Keane
Honored Contributor

Re: link libclntsh dynamic

cc -o vpmadp -Wl,+s vpmadp-main.o vpmadp-vpm_db.o -lpthread -L/usr/app/oracle/product/8.1.7/lib -lclntsh ../src/liborainf.a

then

chatr +s enable vpmadp

If I understand your question correctly that is!


Herbert Simon
Advisor

Re: link libclntsh dynamic

Great!!!!!!

THATS it! Thank you verry much!!!!!

Karsten
Herbert Simon
Advisor

Re: link libclntsh dynamic

Thanks for verry fast help!