Hi,
I am new to Linux env. so I will really appreciate if someone could help with this problem.
I recently installed openmotif-2.3.0-1.fc6.i386.rpm and openmotif-devel-2.3.0-1.fc6.i386.rpm packages using "rpm -Uvh" command.
Then, I ran the following command to compile a simple HelloMotif file (from the net):
cc -o HelloMotif HelloMotif.c -L/usr/X11R6/lib/ -lXm -lXt -lX11
When I tried to run the executable, I got the following eror:
-----------------------
[destroyer ~]$ ./HelloMotif
./HelloMotif: error while loading shared libraries: libXm.so.4: cannot open shared object file: No such file or directory
-----------------------
Here are the permissions for the files:
[destroyer ~]$ ls -al /usr/X11R6/lib/libXm.*
-rw-r--r-- 1 root root 3370122 May 3 2007 /usr/X11R6/lib/libXm.a
lrwxrwxrwx 1 root root 14 Mar 13 13:24 /usr/X11R6/lib/libXm.so -> libXm.so.4.0.0
lrwxrwxrwx 1 root root 14 Mar 13 13:09 /usr/X11R6/lib/libXm.so.4 -> libXm.so.4.0.0
-rwxr-xr-x 1 root root 2683492 May 3 2007 /usr/X11R6/lib/libXm.so.4.0.0
I am completely lost. Can someone please help?
Thanks.
dpeterc
libXm.so.4: cannot open shared object file
You should do
ldconfig
as root, in order to make the system know about the newly installed libraries.
Or you can reboot the computer, and it will be done automatically on startup.
If it still does not work, try
ldd ./HelloMotif
and you will see where does the system search for the libraries,
which does it find, and which not.
Hope this helps
Dušan Peterc
pclayton
libXm.so.4: cannot open shared object file
I have also had a problem with identical symptoms using the fc7 Motif RPM. (It looks like a separate post reported a similar problem using the fc8 RPMs.)
The root cause of this is that the Motif RPMs install files to /usr/X11R6 which doesn't appear to be standard on Fedora installations anymore (It was once) so libraries aren't found automatically. On newer Fedora systems, X libraries now appear to go in /usr/lib. (The devel RPM avoids this issue by creating a symbolic link /usr/include/Xm -> ../X11R6/include/Xm.)
There are several ways to work around this, e.g.
- set the LD_LIBRARY_PATH environment variable at run time, e.g.
LD_LIBRARY_PATH=/usr/X11R6/lib ./HelloMotif
- as root, enter
/sin/ldconfig /usr/X11R6/lib
(I think)
- set the LD_RUN_PATH environment variable at link time
Providing these RPMs is extremely useful and appreciated. It makes Linux simpler to use however this benefit is lost if users need to know about one of the above fixes. It would be great if the Motif RPMs could follow the new Fedora conventions so that applications that previously worked don't break. I'll submit a bug and see what happens :)
Regards,
Phil
Yuriy Syrota
libXm.so.4: cannot open shared object file
This issue is already fixed in CVS, so the fix should be in upcoming 2.3.1 release