Operating System - HP-UX
1753441 Members
4703 Online
108794 Solutions
New Discussion юеВ

Re: Installing shared library

 
SOLVED
Go to solution
Harichand M V
Advisor

Installing shared library

I want to install a shared library.
I created a .h file and .c file and
compiled it as follows
cc -c *.c
gcc -shared -o libsim.so *.o

I copied the libsim.so file to /usr/lib and the .h file to /usr/include. But problem is that I cant access library. I included the .h file in my program. Still not working.Please help!!
4 REPLIES 4
Yogeeraj_1
Honored Contributor

Re: Installing shared library

hi Harichand,

are there any errors generated?

revert

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Matti_Kurkela
Honored Contributor
Solution

Re: Installing shared library

Did you use the "-lsim" option when compiling your program?

What was the error message?

Did it appear when trying to compile your program? Or was the compilation successful but the program displays an error message when you try to run it?

(The correct "-l" option is formed by taking the library name, leaving out the suffix .a, .so or .sl and replacing the "lib" in the beginning with "-l". Thus, libsim.so -> -lsim)

Note that the suffix of the shared library should be .sl instead of .so in PA-RISC-based HP-UX. With Itanium-based versions, .so is the recommended suffix but .sl may be used for backwards compatibility reasons.

Documentation:
http://docs.hp.com/en/11782/LinkerOnliinehelp0709/linkertasks.htm#SPECIFYINGLIBRARIES-LANDL

MK
MK
Harichand M V
Advisor

Re: Installing shared library

Thank you ....
The -lsim option worked for me.........
Harichand M V
Advisor

Re: Installing shared library

I got the answer

using -lsim

Thank you all.......