I'm having a problem with LD_PRELOAD on Linux. I'm trying to load a library existing in a directory with spaces in its name, right before launching my application:
> export LD_PRELOAD='/home/myuser/MyApp\ Test/lib/mylib.so'
However, the path is not being taken properly. It gets split where the space exists, so it tries to preload these:
ERROR: ...: object '/home/myuser/MyApp' from LD_PRELOAD cannot be preloaded: ignored
ERROR: ...: object 'Test/lib/mylib.so' from LD_PRELOAD cannot be preloaded: ignored
I'm already escaping the space in 'MyApp Test'. What is the correct way to pass such path?
Edit: exporting without the escaped space as suggested, renders the same results:
export LD_PRELOAD='/home/myuser/MyApp Test/lib/mylib.so'
As well as (no quotes, just escaped space):
export LD_PRELOAD=/home/myuser/MyApp\ Test/lib/mylib.so
export LD_PRELOAD='/home/myuser/MyApp Test/lib/mylib.so'