doubt in using shared libraries

Hi,
I tried to use vim in target,so i found the NEEDED shared libraries in the
host…I did
$ objdump -x /bin/vim | grep NEEDED and i got response as
libc.so.1 NEEDED

But i have few doubts here
1.I had already included libc.so then why should I use libc.so.1 ?
2.objdump says only libc.so.1 is needed but even when i include it i could
not start vim in target,
$vim test.c (In target)
unable to find shared libraries
3.If i missed some libraries I am restarting my target and I am using new
build to start the target, (Even when i copy .so into flash and when I give
/fs0p0 i.e., flash in my library path,my application is not using it)…Is
there any easy methods for this .??

Regards
Mani

Manigandan Varadharajan <vm@myw.ltindia.com> wrote:

Hi,
I tried to use vim in target,so i found the NEEDED shared libraries in the
host…I did
$ objdump -x /bin/vim | grep NEEDED and i got response as
libc.so.1 NEEDED

But i have few doubts here
1.I had already included libc.so then why should I use libc.so.1 ?

How did you included libc.so.1 in the vim executable? If you link a shared
library against an object the object will depend on the shared library.
Here libc.so is a symlink to libc.so.1.

To statically link libc into your executable perform a command like this:

qcc -o vim /usr/lib/libc.a

where libc.a is the static archive.

However I don’t be sure you’ll want to statically link libc into your
executables. Libc is used often in programs and statically link it into
ALL executables will fill up you target rapidly.

Simply copy the shared library into the target to make it happy.

2.objdump says only libc.so.1 is needed but even when i include it i could
not start vim in target,
$vim test.c (In target)
unable to find shared libraries
3.If i missed some libraries I am restarting my target and I am using new
build to start the target, (Even when i copy .so into flash and when I give
/fs0p0 i.e., flash in my library path,my application is not using it)…Is
there any easy methods for this .??

Regards
Mani






Wave++

libc.so is a symlink to the current libc. That means on a 6.1 (and beyond)
system you will get a libc.so.2 and a libc.so linked to libc.so.2. So you
may have to explicity include libc.so.1. I, however, would just get a
newer version of vim that is build against libc.so.2.

You can also try…

DL_DEBUG=1 vim

…and see what other libs it might be loading by hand.

chris


Manigandan Varadharajan <vm@myw.ltindia.com> wrote:

Hi,
I tried to use vim in target,so i found the NEEDED shared libraries in the
host…I did
$ objdump -x /bin/vim | grep NEEDED and i got response as
libc.so.1 NEEDED

But i have few doubts here
1.I had already included libc.so then why should I use libc.so.1 ?
2.objdump says only libc.so.1 is needed but even when i include it i could
not start vim in target,
$vim test.c (In target)
unable to find shared libraries
3.If i missed some libraries I am restarting my target and I am using new
build to start the target, (Even when i copy .so into flash and when I give
/fs0p0 i.e., flash in my library path,my application is not using it)…Is
there any easy methods for this .??

Regards
Mani




\


Chris McKillop <cdm@qnx.com> “The faster I go, the behinder I get.”
Software Engineer, QSSL – Lewis Carroll –
http://qnx.wox.org/

hi,
But what is this DL_DEBUG=1 vim
where to use it …I dont get you

Thakyou
Manigandan.V


“Chris McKillop” <cdm@qnx.com> wrote in message
news:a49kjh$po9$7@nntp.qnx.com

libc.so is a symlink to the current libc. That means on a 6.1 (and
beyond)
system you will get a libc.so.2 and a libc.so linked to libc.so.2. So you
may have to explicity include libc.so.1. I, however, would just get a
newer version of vim that is build against libc.so.2.

You can also try…

DL_DEBUG=1 vim

…and see what other libs it might be loading by hand.

chris


Manigandan Varadharajan <> vm@myw.ltindia.com> > wrote:

Hi,
I tried to use vim in target,so i found the NEEDED shared libraries in
the
host…I did
$ objdump -x /bin/vim | grep NEEDED and i got response as
libc.so.1 NEEDED

But i have few doubts here
1.I had already included libc.so then why should I use libc.so.1 ?
2.objdump says only libc.so.1 is needed but even when i include it i
could
not start vim in target,
$vim test.c (In target)
unable to find shared libraries
3.If i missed some libraries I am restarting my target and I am using
new
build to start the target, (Even when i copy .so into flash and when I
give
/fs0p0 i.e., flash in my library path,my application is not using
it)…Is
there any easy methods for this .??

Regards
Mani







\

Chris McKillop <> cdm@qnx.com> > “The faster I go, the behinder I get.”
Software Engineer, QSSL – Lewis Carroll –
http://qnx.wox.org/

“Manigandan Varadharajan” <vm@myw.ltindia.com> wrote in message
news:a4b5ij$7un$1@inn.qnx.com

hi,
But what is this DL_DEBUG=1 vim
where to use it …I dont get you

look for DL_DEBUG in http://cvs.qnx.com/cgi-bin/cvsweb.cgi/lib/c/ldd/
sources


Best regards,
vasa mailto:vasilii@cambira.com

Manigandan Varadharajan <vm@myw.ltindia.com> wrote:

hi,
But what is this DL_DEBUG=1 vim
where to use it …I dont get you

Instead of just trying to run “vim filename.txt” you run
“DL_DEBUG=1 vim filename.txt”.

chris

\

Chris McKillop <cdm@qnx.com> “The faster I go, the behinder I get.”
Software Engineer, QSSL – Lewis Carroll –
http://qnx.wox.org/