0

I'm trying to set just specific env variable:

export LD_LIBRARY_PATH=mqlibs/lib64
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:mqlibs/lib64
export LD_LIBRARY_PATH="mqlibs/lib64"

It doesn't work wherever I set it. (in .bashrc or .bash_profile or just in Terminal) But this simple one does work:

export aaa=test

what am I doing wrong?

John Glabb
  • 1,336
  • 5
  • 22
  • 52

1 Answers1

0

You asked "what am I doing wrong?" Your first mistake is not clearly describing the problem :-) Saying "it doesn't work" doesn't tell us much. What did you expect and what did you observe? All of the export statements work for me in as much as they create an env var with the expected value.

Your main problem is that LD_LIBRARY_PATH has no special meaning on macOS. You should use DYLD_LIBRARY_PATH instead. See man dlopen and related S.O. questions like Is it OK to use DYLD_LIBRARY_PATH on Mac OS X? And, what's the dynamic library search algorithm with it?.

Kurtis Rader
  • 6,734
  • 13
  • 20