0

I am trying to develop statically linked OCi/OCCI application and I am getting lots of undefined errors like following.

Can somebody tell me which .a libs to be included at link line.

Thanks.

/u01/home/oracle/product/12.1.0.2/lib/libnls12.a(lxxmlidc.o): In function lxXmlIdConv': lxxmlidc.c:(.text+0x15d): undefined reference tolxuCvtToCtx' lxxmlidc.c:(.text+0x23f): undefined reference to lxu4TstClass' lxxmlidc.c:(.text+0x36f): undefined reference tolxu4TstClass' lxxmlidc.c:(.text+0x386): undefined reference to lxu4TstClass' lxxmlidc.c:(.text+0x39d): undefined reference tolxu4TstClass' lxxmlidc.c:(.text+0x3be): undefined reference to lxu4TstClass' /u01/home/oracle/product/12.1.0.2/lib/libnls12.a(lxxmlidc.o):lxxmlidc.c:(.text+0x7d4): more undefined references tolxu4TstClass' follow /u01/home/oracle/product/12.1.0.2/lib/libnls12.a(lxuca.o): In function lxucaFindLastNonCombiningChar': lxuca.c:(.text+0xc82): undefined reference tolxu4GCombiningClass' /u01/home/oracle/product/12.1.0.2/lib/libnls12.a(lxuca.o): In function lxucaFindTrimPosition': lxuca.c:(.text+0xfd6): undefined reference tolxuCvtToCtx' /u01/home/oracle/product/12.1.0.2/lib/libnls12.a(lxuca.o): In function lxucaGetKey': lxuca.c:(text.hot+0xb2c): undefined reference tolxuComposition' lxuca.c:(text.hot+0xe06): undefined reference to lxu4GCombiningClass' lxuca.c:(text.hot+0xeaa): undefined reference tolxu4GCombiningClass' lxuca.c:(text.hot+0x112b): undefined reference to lxu4GCombiningClass' /u01/home/oracle/product/12.1.0.2/lib/libnls12.a(lxuca.o): In functionlxucaConvertAndDecompose': lxuca.c:(text.hot+0x181a): undefined reference to lxuDecomposition' /u01/home/oracle/product/12.1.0.2/lib/libnls12.a(lxuca.o): In functionlxucaGetImplicitWeightBase': lxuca.c:(text.hot+0x1b16): undefined reference to lxu4GBlock' /u01/home/oracle/product/12.1.0.2/lib/libnls12.a(lxpisac.o): In functionlxpIsACollationElement': lxpisac.c:(.text+0x2fc): undefined reference to lxuCvtToCtx' /u01/home/oracle/product/12.1.0.2/lib/libnls12.a(lxpisac.o): In functionlxpNumOfUc4CollationElem': lxpisac.c:(.text+0x753): undefined reference to lxuCvtToCtx' lxpisac.c:(.text+0x91a): undefined reference tolxuComposition' /u01/home/oracle/product/12.1.0.2/lib/libcore12.a(lrmini.o): In function lrminiu': lrmini.c:(.text+0x5b6): undefined reference tolxuCvtToCtx' /u01/home/oracle/product/12.1.0.2/lib/libcore12.a(lrmpu.o): In function lrmpu16to8': lrmpu.c:(text.unlikely+0x57): undefined reference tolxuStrLen' /u01/home/oracle/product/12.1.0.2/lib/libcore12.a(lsf.o): In function lsfiniu': lsf.c:(.text+0x551): undefined reference tolxuCvtToCtx' /u01/home/oracle/product/12.1.0.2/lib/libcore12.a(lsfu.o): In function lsfu16to8': lsfu.c:(text.unlikely+0x65): undefined reference tolxuStrLen' /u01/home/oracle/product/12.1.0.2/lib/libcore12.a(lrmckv.o): In function lrmckv': lrmckv.c:(.text+0x54f): undefined reference tolxuCmpBinStr' /u01/home/oracle/product/12.1.0.2/lib/libcore12.a(lrmpatk.o): In function lrmpatk': lrmpatk.c:(text.unlikely+0x2f1): undefined reference tolxuCmpBinStr' /u01/home/oracle/product/12.1.0.2/lib/libcore12.a(lrmcvv.o): In function lrmcvv': lrmcvv.c:(.text+0x219): undefined reference tolxuCmpBinStr'

Chandu
  • 1,837
  • 7
  • 30
  • 51
  • I did this once many years ago. aside the library liclntsh.so there is also a library libclntst.a (sh-shared, st-static). Look at the relink script - this one might generate the static version of the library. Also I recall I needed static version of some libs shipped with Intel's ICC compiler(Oracle does not use gcc). Simply write a script that uses `nm` and try to find missing symbols in all `.a` `.o` files shipped with Oracle installation. What command you use to link your app? – ibre5041 Jun 17 '15 at 08:46
  • g++. Is libclntst.a static equivalent of libclntsh.so ? – Chandu Jun 17 '15 at 09:08
  • I used to be. As I remember on ver. 8i/9i. See post installation tasks: http://docs.oracle.com/html/B10811_05/ch4.htm. But even if I used this library I had to find some symbols from ICC compiler. Something like __fast_memcpy. I think even gcc has its libgcc library which contains necessary runtime functions. – ibre5041 Jun 17 '15 at 09:13
  • I am using nm and finding the .a files to include at link line. Does ordering of those files on Link line matters ? If so what should be the ordering ? – Chandu Jun 17 '15 at 10:01
  • I'm not sure. ld should complain about implicitly defined symbols (but I'm not sure about weak-symbols). PS: I do not have an access to any Linux box ATM. – ibre5041 Jun 17 '15 at 10:37
  • Thanks I have used nm command for all the symbols on all Oracle libraries and included them in link line. After trying some permutations and combinations it got linked – Chandu Jun 18 '15 at 16:52

1 Answers1

1

Thanks I have used nm command for all the symbols on all Oracle libraries and included them in link line. After trying some permutations and combinations it got linked

Chandu
  • 1,837
  • 7
  • 30
  • 51
  • 1
    you should publish what you came up with for the next poor sob that finds themselvs in the same situation. – EvilTeach Jun 18 '15 at 16:55
  • For each symbol not found error ...goto lib dir under Oracle ... use nm command to find the .a file in which the symbol exists and and that file to link line. – Chandu Jun 25 '15 at 10:26