[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

RE: shared library problem



1> gcc -shared -o libmylib.so test.c 

	Note: mylib.so is to be changed to libmylib.so

2> su ( Become Super User )

3> mv libmylib.so /lib

4> /sbin/ldconfig -n /lib ( See if this instruction can be skipped or not )

5> then u can link it with -lmylib

Following the above approach doesn't give "no such file or directory"


> -----Original Message-----
> From:	Vani R. [SMTP:vani@xxxxxxxxxxxxxxx]
> Sent:	Thursday, February 08, 2001 5:05 PM
> To:	linux-india-programmers@xxxxxxxxxxxxxxxxxxxxx
> Subject:	Re: [LIP] shared library problem
> 
> Hi sumit,
> 
> That's fine. It works for me also. but what i want is using -L and -l
> options.
> I am giving the library path where the .so file is existing and -l option
> to
> specify the library name ( mylib.so ) . But when i use these options , i
> am
> getting error as "mylib.so - no such file or directory" . What should i do
> ??
> 
> Thanks ,
> --vani--
> 
> Sumit Rangawala wrote:
> 
> > Hi Vani
> >     just do  gcc <libfile>  <source file>  -o <outputfile> and it will
> work
> > .
> > Its not necessary for you to have the name of the libfile to start with
> > "lib"
> >
> > Regards
> > Sumit
> >
> > "Vani R." wrote:
> >
> > > Hi All,
> > >
> > > I have a small problem linking to shared library.
> > > I have created a shared library using " gcc -shared -o mylib.so
> test.c"
> > > when i try to link it using the -L option specifying the directory
> where
> > > this library is along with -l option specifying the library name , it
> > > says , No such file or directory.Can anybody please help me in using
> > > shared libraries created by us.
> > >
> > > Thanking in advance,
> > > --vani--
> > >
> > > --
> > > Many of the life's failures are people who didn't realize how close
> they
> > > were to success
> > > when they gave up
> > >       --Thomus Edison
> > >
> > > ---------------------------------------------
> > > LIP is all for free speech.  But it was created
> > > for a purpose.  Violations of the rules of
> > > this list will result in stern action.
> >
> > ---------------------------------------------
> > An alpha version of a web based tool to manage
> > your subscription with this mailing list is at
> > http://lists.linux-india.org/cgi-bin/mj_wwwusr
> 
> --
> Many of the life's failures are people who didn't realize how close they
> were
> to success
> when they gave up
>       --Thomus Edison
> 
> 
> 
> ---------------------------------------------
> LIP is all for free speech.  But it was created
> for a purpose.  Violations of the rules of
> this list will result in stern action.