Solved

About Link library!

Posted on 2003-11-11
9
234 Views
Last Modified: 2010-04-22
System: Readhat Linux System
kernerl:2.4.e16smp
gcc version: 2.2.4.96
I compile a file and create a executable file,
when linking the file, it need a library "libma00000.so" in Dir [/home/cmgs/lib ]
but After I create the file, when I run it , some errors occured.
error message:
bash-2.05$ make -f bb0dl000.mk
cc -O2 -march=i686 -Wall -g -ansi -fPIC -c -I/home/cmgs/include bb0dl000.c
cc  -o bb0dl000 bb0dl000.o -L /home/cmgs/lib -lma00000 -g
bash-2.05$ ./bb0dl000
./bb0dl000: error while loading shared libraries: libma00000.so: cannot open shared object file: No
such file or directory


wait for your answer! Thanks!
0
Comment
Question by:lakeryu
  • 4
  • 3
9 Comments
 
LVL 5

Expert Comment

by:g0rath
ID: 9722528
This is because when it attempts to execute the program it shows that it needs to link to a shared object, it will look for then in the paths as defined in /etc/ld.so.conf.

You can override this at run time to have it look in your local directory by setting the LD_LIBRARY_PATH

$ export "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/cmgs/lib"
0
 

Author Comment

by:lakeryu
ID: 9736419
Thank you very much for your answer!
that problem has been soluted. but when execute the application(bb0dl000) a new error occured.following is the error message:
./bb0dl000: /lib/i686/libc.so.6: version `GLIBC_2.0' not found (required by /home/cmgs/lib/libma00000.so)

comment:the libma00000.so is complied by another machine.But I do not know the machine`s glibc version. by the error message, is it possible to be sure that the machine`s glibc version is glibc~2.0???

how can I solute it?? wait for your answer? thank you!
0
 
LVL 5

Expert Comment

by:g0rath
ID: 9737279
it would apprear that the other machine that compiled the .so file had the newer glibc, and your running on an older glibc...

easiest method would be to get the source and remake the .so file.

glibc is mostly backward binary compatible, but not forward.
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

Author Comment

by:lakeryu
ID: 9737422
hello, g0rath
but it looks like that my glibc version is newer than the compile machine.
And I can not get the lib source, how can I do??
g0rath, can you help me?
wait for your answer!
0
 

Author Comment

by:lakeryu
ID: 9737425
hello, g0rath
but it looks like that my glibc version is newer than the compile machine.
And I can not get the lib source, how can I do??
g0rath, can you help me?
wait for your answer!
0
 
LVL 5

Accepted Solution

by:
g0rath earned 50 total points
ID: 9739253
So you need the glibc-compat rpms

Follow this link and find the one that you need

http://rpmfind.net/linux/rpm2html/search.php?query=compat-glibc
0
 

Author Comment

by:lakeryu
ID: 9745559
Yes I have soluted it,
But now when I debug it using gdb, it found some serious problem.
for example:
In gdb when I break it at line88, and press "next" to run the next step, but it don't  run the next step line89, thought it return the less than line88(for example line 80 81 and so on)..

what cause the phenomina? and how can I solute it?? Why ? and I confused it!
wait for your answer!
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question