Home:ALL Converter>LD_LIBRARY_PATH not working while LD_PRELOAD works fine

LD_LIBRARY_PATH not working while LD_PRELOAD works fine

Ask Time:2012-12-11T20:12:25         Author:pythonic

Json Formatter

I am compiling a program on one machine and running it on another one which does not have compatible libstdc++ library. If I run it like this, that is using LD_PRELOAD, it runs fine.

LD_PRELOAD=./libstdc++.so.6 ./program args

However, If I try to use LD_LIBRARY_PATH, like shown below, it doesn't load the library and I get the error that I don't have the required libstdc++ version.

export LD_LIBRARY_PATH="./libstdc++.so.6"
./program args

How can I solve this problem?

Author:pythonic,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/13820171/ld-library-path-not-working-while-ld-preload-works-fine
hyde :

You need to give paths in LD_LIBRARY_PATH variable:\n\nLD_LIBRARY_PATH=$PWD ./program args\n",
2012-12-11T12:32:04
yy