Temporarily changing the path of libraries in Linux

Configurare noua (How To)

Situatie

Taking into consideration that usage of static libraries have problems like:

  • huge program file
  • program can’t take advantage of the improvement of libraries without being recompiled

Usage of dynamic libraries would be a good idea.

To use dynamic libraries we can set the path systemwide or temporarily changing the path. In this article, we will see how to set a path temporarily.

Sometimes , it’s inappropriate to change the path of libraries definitively so, if you want to test the effect of a new library for all of your programs you can do this:

  • Install the shared libraries in a different location (for example in /usr/local/testlib and opt/newlib)
  • use an environment variable (LD_LIBRARY_PATH)
  • use this sintax to set the new variable ($ export LD_LIBRARY_PATH=/usr/local/testlib:/opt/newlib)

Solutie

Pasi de urmat

Tip solutie

Permanent
Etichetare:

Voteaza

(6 din 14 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?