Operating System - Linux
1753505 Members
6860 Online
108794 Solutions
New Discussion

How to resolve "Can't find library or mismatched ABI for –lclntsh"

 
xinm
Advisor

How to resolve "Can't find library or mismatched ABI for –lclntsh"

Hello friends:
When I compiled a pro*c program,It happens errors:
.......
ld: Can't find library or mismatched ABI for –lclntsh
.......

My makefile includes "-L$(ORACLE_HOME)/lib -lclntsh".
Then,I checked the file "libclntsh.so" is in the $ORACLE_HOME/lib/ path ,and "LD_LIBRARY_PATH" includes the “$ORACLE_HOME/lib”path.

MY Program s Environment:
machine : ia64 hp server rx4640
OS info:
sysname = HP-UX
release = B.11.23
gcc version 4.0.4

And now I don't know how to resolve this problem.I hope somebody can help me.
Thanks!
7 REPLIES 7
Steven Schweda
Honored Contributor

Re: How to resolve "Can't find library or mismatched ABI for –lclntsh"

file $ORACLE_HOME/lib/libclntsh.so

It might help to see the whole link command
from the "make" file.
Dennis Handly
Acclaimed Contributor

Re: How to resolve "Can't find library or mismatched ABI for –lclntsh"

You're on IPF and so you need to specify a path like lib/hpux32 or lib/hpux64.

>Steven: file $ORACLE_HOME/lib/libclntsh.so

You may need to insert hpux32 before the lib?
xinm
Advisor

Re: How to resolve "Can't find library or mismatched ABI for –lclntsh"

>to Steven Schweda,my makefile linked command:
MAKEEXE= g++ -v â Wall -L$(ORACLE_HOME)/rdbms/lib -L$(ORACLE_HOME)/lib -lclntsh
Analyse: $(PUB_OBJS) $(CONFIG_PARA_OBJS) $(APP_OBJS)
$(MAKEEXE) â o Analyse $(PUB_OBJS) $(CONFIG_PARA_OBJS) $(APP_OBJS)

>to Dennis Handly
Before I ask for helping ,I tried to add â lib/hpux32 â in the â LD_LIBRARY_PATHâ ,and file â libclntsh.soâ is in this path,the error still happenes.
Dennis Handly
Acclaimed Contributor

Re: How to resolve "Can't find library or mismatched ABI for –lclntsh"

>Before I asked for help, I tried to add "lib/hpux32" in the "LD_LIBRARY_PATH" and file "libclntsh.so" is in this path, the error still happens.

The linker doesn't look at LD_LIBRARY_PATH. It looks at -L or LPATH.
Steven Schweda
Honored Contributor

Re: How to resolve "Can't find library or mismatched ABI for –lclntsh"

> file $ORACLE_HOME/lib/libclntsh.so

That was intended as a suggestion to run that
command. (And post the output.)
xinm
Advisor

Re: How to resolve "Can't find library or mismatched ABI for –lclntsh"

Thanks all!
When I copied the "libclntsh.so" from the path "$ORACLE_HOME/lib" to the path "/lib/hpux32",then define "-L/lib/hpux32" in my makefile,then everything is ok.
But I tried to delete "libclntsh.so" from "/lib/hpux32",then define "-L$ORACLE_HOME/lib" in my makefile,error still happened!
Can somebody tell me why this happen?
Thanks,my friends!
Dennis Handly
Acclaimed Contributor

Re: How to resolve "Can't find library or mismatched ABI for –lclntsh"

>When I copied the libclntsh.so from the path $ORACLE_HOME/lib to the path /lib/hpux32, then define -L/lib/hpux32 in my makefile,then everything is ok.

So, stick with what works.

>But I tried to delete libclntsh.so from /lib/hpux32, then define -L$ORACLE_HOME/lib in my makefile, error still happened!
>Can somebody tell me why this happen?

I would have to see what your linker options are. There may be other dependent shlibs that want that old path.