C
C
calculator2122021-11-12 10:13:37
C++ / C#
calculator212, 2021-11-12 10:13:37

How to link so to executable in ubuntu?

I know that they usually use static linking to enable the program to work on different PCs, but it’s still interesting how to do it with so, for example, with qt I often see programs that access internal dynamic dll / so files to work, so the question arose of how you can tell the program in ubunt the path to your own (internal so), i.e. found all the dependencies through ldd, for example, copied to a folder and transferred to another machine.
I found only an option in order to run the program like this, LD_LIBRARY_PATH=so_test/ ./app , but here you either need to write a script, or write it every time you start, which is not very convenient, so I want to know how else you can specify a folder for the program with dynamic libraries so that they are local and used only for this program.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
pfg21, 2021-11-12
@calculator212

pack the program with all the libs into a canned application package flatpack, snappy, appimage and the like.
inside the package, the program will cook in its sandbox with all the blackjacks and what is due that they put in the package.
------------------
write a script (or a batch file/cmd, in Windows terms) to prescribe everything you need there.
LD_LIBRARY_PATH=path/to/lib; program

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question