Getting run time error on libc.a[shr.o]

I am trying to compile a program on AIX 4.2.1. The program compiles without any errors, but when I run it, it gives me the following error:

# upper
exec(): 0509-036 Cannot load program upper because of the following errors:
        0509-022 Cannot load library libc.a[shr.o].
        0509-026 System error: A file or directory in the path name does not exist.

I have checked /usr/lib and it does have a libc.a file. But I don't know what does [shr.o] mean here. If it is a file which directory I should look for it?

Any clue??

Who is Participating?
bedotConnect With a Mentor Commented:
AIX 4.x use dynamic libraries on execution, that reduce the code, and modules are loaded when necessary;
to do that, the compile call the function shr, which is an object of libc.a:
the command ar t /usr/li/libc.a give the table of all the objects in libc.a:

for a part only:


check if your library contains this shr.o
1° yes:  either you haave compiled your source on another box, and different version, either your archive libc.a has been modified (adding some personal function ...?...), or is corrupted;
with great precautions (save-copy before), try to restore an oldier version of libc.a, or try to re-create the index onto the library with the ralib command on this library

2° no: this object has disappear ; why?? mystery; restore an oldier with same precautions

OTHER: check for the option of cc that permit to unuse dynamic libraries (including onto the code the necessaries functions, avoiding to have to use dynamic libraries)

(I know this option exists, but i've forgotten the way to do)

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.