0

I am currently using a program which called " Write " created by Stylus Labs. It is a single file application which uses the QT5.7 libs. It running on my Laptop with Ubuntu 16.04 x64 Bit.
Actually this program targets Ubuntu 17 and doesn't run natively on Ubuntu 16.04 because of missing QT5.7 libraries.
After changing and renaming manually all required libraries in /usr/lib/x86_64-linux-gnu the program works fine.
But because of this mishmash qt based programs like Teamviewer stop working due to confusion.

I would like to change the target of this program so I can leave the systems libs as they are and paste the required libs into the folder of the application.

I have already tried pasting the required files into the same folder in which the application is and it didn't work. I Have also installed QT 5.7.1 and set the newer folders as default system wide, but with no luck. Write is still looking at /usr/lib/x86.. .

I hope my question is clear, and if it's not, please tell me how I can clarify.


Following libraries were copied and pasted from

/Qt5.7.1/5.7/gcc_64/lib/xxx.so.5.7.1

to

/usr/lib/x86_64-linux-gnu/xxx.so.5

to make Write work on ubuntu 16.04:

libicudata.so.56
libicudata.so.56.1
libicui18n.so.56
libicui18n.so.56.1
libicuuc.so.56
libicuuc.so.56.1
libQt5Core.so.5
libQt5Gui.so.5
libQt5Network.so.5
libQt5Svg.so.5
libQt5Widgets.so.5


Solve:

  1. Install at least QT 5.7.1 onto your system.
  2. Open a Terminal and type export LD_LIBRARY_PATH=/Path/to/QT/Qt5.7.1/5.7/gcc_64/lib/
  3. Open Write through this Terminal /path/to/writeExecutable/Write
    Done

After closing this Terminal or using another Terminal window, you have to repeat this process.

4
  • 1
    It's not guaranteed to work (it will depend on the rpath / runpath options used to build the executable) but you could try LD_LIBRARY_PATH=path/to/Qt5.7/libs name_of_program Commented Mar 15, 2019 at 13:28
  • Thank you for your help. Can I set this up in some .bashrc or just over the Terminal. I cannot find anything realy helpful on the internet regarding LD_LIBRARY_PATH and how to set it up. How to undo it if I mess something up? Can you give me please some explicite examples?
    – farhad94
    Commented Mar 15, 2019 at 15:02
  • If it works as a one-off from the command line, I'd probably suggest creating a little wrapper script somewhere early in your PATH (either ~/bin or - if others need to use it - /usr/local/bin in which you set + export LD_LIBRARY_PATH and then run the program with its full path. You can't really mess up much since the variable assignment will only apply in that shell + its children. Commented Mar 15, 2019 at 15:26
  • It works now perfectly! Thank you very much!
    – farhad94
    Commented Mar 19, 2019 at 21:21

1 Answer 1

0

To edit the executable itself to use libreplacement.so.1 instead of liboriginal.so.1 in my_program executable:

patchelf --replace-needed liboriginal.so.1 libreplacement.so.1 my_program

To see what dependencies executable currently has:

ldd my_program

From here: How can I change the filename of a shared library after building a program that depends on it?

2
  • Thank you for your reply. Can I also change the path/directory the executable is looking for?
    – farhad94
    Commented Mar 19, 2019 at 21:21
  • @farhad94, that's changing the rpath: patchelf --set-rpath /dir/libs/ my_program. StackOverflow answer: stackoverflow.com/a/20333550
    – Velkan
    Commented Mar 20, 2019 at 10:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .