My executable was linked under RedHat using the LessTif GUI shared library. When I try to run it under UBUNTU, I get an error message that the LessTif library cannot be found. The LessTif library is there, but it is a newer VERSION. My executable is looking for the older version it was linked with.
So how do I make my executable smart enough to find the LessTif shared library on the system it is running on, even if it is a different version?
Alternatively, how can I statically link the LessTif shared library components that I am using into my executable.
I'm using 'make' to build. Yeah, I'm old.
Thanks all.
Hello Imagtek,
The information about the LessTiff dynamic library to use (path/version) is coded in the binary. When you start it on Ubuntu, the dynamic loader try to load it based on the information stored in the binary. If that fails (wrong path or version), it complains. This is the expected behavior.
Now to solve your problem, I see two possibilities:
- You create a symlink at the right place that points to your the LessTiff .so library installed on your Ubuntu system. You can find out what the dynamic linker is looking for using the ldd command: ldd <your_binary>. For instance:
$ ldd /bin/ls
shows up all the dynamic libraries the 'ls' binary needs.
See however note below.
- You recompile your program for Ubuntu. Depending on your program, this may invokes the ./configure; make all; make install steps.
Please note that usually a version increase in dynamic library means possibility some "incompatibilities" with the previous version. So, things might break. This explain why solution 1 may not work. At best, you should try to recompile for your target system.
And by the way, my grand-father started learning computer at age 65 and pass me the virus (I was 13), and my father-in-law started recently tinkering with Linux. So, don't worry 
HTH,
Lo�c
--
My (Unix) blog: Lo�c OnStage
"The most amazing achievement of the computer software industry is its continuing cancellation of the steady and staggering gains made by the computer hardware industry." -- Henry Petroski