Operating System - HP-UX
1833875 Members
2136 Online
110063 Solutions
New Discussion

location of library files -lpthread and -lm in 11V2

 
SOLVED
Go to solution
sathis kumar
Frequent Advisor

location of library files -lpthread and -lm in 11V2

Hello,

We are currently migrating our applications from 11i to 11V2. Our Oracle database version is 10g.
We are trying to compile a demo program which is available under oracle installation directory.
Following is the command used to compile a sample program.

cc -w +DD32 -c
-I/opt/oracle/product/10.2.0/rdbms/demo -I/opt/oracle/product/10.2.0/rdbms/public -I/opt/oracle/product/10.2.0/plsql/public -I/opt/oracle/product/10.2.0/network/public -I/opt/oracle/product/10.2.0/precomp/public oci11.c

and following is the command to build the executable 'oci11' after linking :

cc -Wl,+s -Wl,+n +DD32 -L/opt/oracle/product/10.2.0/lib32/ -L/opt/oracle/product/10.2.0/rdbms/lib32/ -o oci11 oci11.o /opt/oracle/product/10.2.0/lib32/libclntst10.a -lpthread -lm

In the above, we need some clarification on the libraries used for linking i.e. the libraries libpthread.a and libm.a ( -lthread and -lm ) are referred from which directory ? Are those libraries present under /usr/lib ? or in some other directory ? Could you please confirm ?

Thanks in advance for your help.
3 REPLIES 3
Dennis Handly
Acclaimed Contributor
Solution

Re: location of library files -lpthread and -lm in 11V2

The linker automatically uses the default lib path to find those libs.
For PA they are in: /usr/lib/
For IPF, they are in: /usr/lib/hpux??/
(Where ?? is either 32 or 64.)
sathis kumar
Frequent Advisor

Re: location of library files -lpthread and -lm in 11V2

Hello,

Thanks for your reply. We are using IPF and checked the files libpthread.a under /usr/lib/hpux32 ( as we are using 32 bit ). But the file is not present under /usr/lib/hpux32. But the linking is going through fine if we give the following command :

cc -Wl,+s -Wl,+n +DD32 -L/opt/oracle/product/10.2.0/lib32/ -L/opt/oracle/product/10.2.0/rdbms/lib32/ -o oci11 oci11.o /opt/oracle/product/10.2.0/lib32/libclntst10.a -lpthread -lm

Could you please let us know from where libpthread.a file is getting referred ?

Thanks in advance for your help.
Dennis Handly
Acclaimed Contributor

Re: location of library files -lpthread and -lm in 11V2

>But the file is not present under /usr/lib/hpux32.

Sure it is. :-)
It's verboten to use system archive libs and so libc.a, libpthread.a and others were removed to solve this issue.

You should look for libpthread.so.1.

If you link with "-Wl,-t", you can see what files ld is actually using.