Link to home
Start Free TrialLog in
Avatar of lakeryu
lakeryu

asked on

About Link library!

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!
Avatar of g0rath
g0rath

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"
Avatar of lakeryu

ASKER

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!
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.
Avatar of lakeryu

ASKER

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!
Avatar of lakeryu

ASKER

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!
ASKER CERTIFIED SOLUTION
Avatar of g0rath
g0rath

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lakeryu

ASKER

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!