Operating System - HP-UX
1753460 Members
4598 Online
108794 Solutions
New Discussion

ld: Can't find library for -lclntsh

 
dictum9
Super Advisor

ld: Can't find library for -lclntsh

11.31. Using standard cc compiler.

how do I correctly link the library?   It is apparently not on the system, where do I install it from?

 

 

When I try to compile some C code, I get this, any idea what it means? I am on 11.31.  Using native CC compiler.


        cc -o /var/tmp/mup mupp.o -L/lib/hpux64 -L/lib/ -lclntsh `cat /lib/ldflags`   `cat /lib/sysliblist`  -lelf -lm   -lrt
ld: Can't find library for -lclntsh
Fatal error.
*** Error exit code 1

10 REPLIES 10
Steven Schweda
Honored Contributor

Re: ld: Can't find library for -lclntsh

> how do I correctly link the library?   It is apparently not on the
> system, where do I install it from?

   With my weak psychic powers, I don't really know.  Have you tried
asking the people who supplied your (invisible) "some C code"?  Who told
you to specify "-lclntsh"?  I know nothing, but a Web search for
"libclntsh" suggested to me that Oracle might be involved.

Dennis Handly
Acclaimed Contributor

Re: ld: Can't find library for -lclntsh

>cc ... -L/lib/hpux64 -L/lib/ -lclntsh `cat /lib/ldflags` `cat /lib/sysliblist` -lelf -lm  -lrt

 

Is this a 64 bit Integrity app?

These paths don't really exist: -L/lib/hpux64 -L/lib/

Remove them and take the defaults.

Also, what does this show?  cat /lib/sysliblist

 

Ask Steven asked, where to you have your Oracle shlibs?

dictum9
Super Advisor

Re: ld: Can't find library for -lclntsh

# ll -d /lib/hpux64                                                                                    #07/31/15 1:02PM#
dr-xr-xr-x  10 bin        bin           8192 Feb 16  2011 /lib/hpux64

# cat /lib/sysliblist                                                                                  #07/31/15 1:02PM#
-lrt -ldl -lm -lpthread -lnsl -lunwind -ldiskown
siddev2w:/comp/source#                                                                      

Dennis Handly
Acclaimed Contributor

Re: ld: Can't find library for -lclntsh

># ll -d /lib/hpux64              

 

The correct path for 64 bit is /usr/lib/hpux64.  But as I said, leave the defaults off.

 

># cat /lib/sysliblist

 

There is nothing here (-L) that points to the Oracle lib directory.

dictum9
Super Advisor

Re: ld: Can't find library for -lclntsh

Now I get this, when I run the make command.

 

I have ncurses 5.9 installed on the system, how do I make sure the compiler recognizes them? Seems the compiler is not finding the ncurses libraries. 

 

I updated these varables to reflect the correct path:

 

echo $SHLIB_PATH
/oracle/app/product/fmw11g/forms/lib:/usr/local/lib/hpux32/:/usr/local/lib/hpux32/:/usr/lib/hpux64

 


# make -f /comp/bin/proc.mk build INAME=pum109p.pc EXE=/var/tmp/pum109p_temp2 OBJS=pum109p.o
        cc -o /var/tmp/pum109p_temp2 pum109p.o -L/lib/hpux64 -L/oracle/app/product/fmw11g/forms/lib/ -lclntsh `cat /oracle/app/product/fmw
11g/forms/lib/ldflags`   `cat /oracle/app/product/fmw11g/forms/lib/sysliblist`  -lelf -lm   -lrt
ld: Unsatisfied symbol "mvwprintw" in file pum109p.o
ld: Unsatisfied symbol "initscr" in file pum109p.o
ld: Unsatisfied symbol "endwin" in file pum109p.o
ld: Unsatisfied symbol "wgetstr" in file pum109p.o
ld: Unsatisfied symbol "wnoutrefresh" in file pum109p.o
ld: Unsatisfied symbol "mvprintw" in file pum109p.o
ld: Unsatisfied symbol "wrefresh" in file pum109p.o
ld: Unsatisfied symbol "noecho" in file pum109p.o
ld: Unsatisfied symbol "wmove" in file pum109p.o
ld: Unsatisfied symbol "echo" in file pum109p.o
ld: Unsatisfied symbol "stdscr" in file pum109p.o
ld: Unsatisfied symbol "mvaddstr" in file pum109p.o
ld: Unsatisfied symbol "waddch" in file pum109p.o
13 errors.
*** Error exit code 1

Dennis Handly
Acclaimed Contributor

Re: ld: Can't find library for -lclntsh

>how do I make sure the compiler recognizes them?

 

You need to pass -L and -l to the driver to pick up these shlibs.

For aC++ you can look at:

http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/HTML/libs.htm

 

>I updated these varables to reflect the correct path: echo $SHLIB_PATH

 

SHLIB_PATH is NOT used during linking, only during execution.

dictum9
Super Advisor

Re: ld: Can't find library for -lclntsh

It does compile the program. But when I run it, I get this. It looks like it cannot find the curses package, which I do have installed on the system.

 

 

/usr/lib/hpux64/dld.so: Unsatisfied data symbol 'stdscr' in load module '/var/tmp/temp2'.
Killed

dictum9
Super Advisor

Re: ld: Can't find library for -lclntsh

ldd /var/tmp/temp2

/var/tmp/temp2:
        libclntsh.so.11.1 =>    /oracle/app/product/fmw11g/forms/lib/libclntsh.so.11.1
        libdl.so.1 =>   /lib/hpux64/libdl.so.1
        libm.so.1 =>    /lib/hpux64/libm.so.1
        libpthread.so.1 =>      /lib/hpux64/libpthread.so.1
        libnsl.so.1 =>  /lib/hpux64/libnsl.so.1
        libunwind.so.1 =>       /lib/hpux64/libunwind.so.1
        libelf.so.1 =>  /lib/hpux64/libelf.so.1
        librt.so.1 =>   /lib/hpux64/librt.so.1
        libc.so.1 =>    /lib/hpux64/libc.so.1
        libnnz11.so =>  /oracle/app/product/fmw11g/forms/lib/libnnz11.so
        libdl.so.1 =>   /usr/lib/hpux64/libdl.so.1
        libm.so.1 =>    /usr/lib/hpux64/libm.so.1
        libpthread.so.1 =>      /usr/lib/hpux64/libpthread.so.1
        libnsl.so.1 =>  /usr/lib/hpux64/libnsl.so.1
        libunwind.so.1 =>       /usr/lib/hpux64/libunwind.so.1
        libc.so.1 =>    /usr/lib/hpux64/libc.so.1
        libxti.so.1 =>  /usr/lib/hpux64/libxti.so.1
        libuca.so.1 =>  /usr/lib/hpux64/libuca.so.1
        libdl.so.1 =>   /usr/lib/hpux64/libdl.so.1

 

 

dictum9
Super Advisor

Re: ld: Can't find library for -lclntsh

 > You need to pass -L and -l to the driver to pick up these shlibs.

 

how do I do that? and what is the path for the curses library to use, which is what it's missing.