Compiling dynamic library with ACLIC using "-rpath"

Ok, I found what I need.
I should manually add -Wl,-rpath=/usr/local/lib/NSutils to fMakeSharedLib using gSystem->SetMakeSharedLib().

So:

  1. I get the fMakeSharedLib with gSystem->GetMakeSharedLib()
  2. Insert -Wl,-rpath=/my/path right before "$LinkedLibs"
  3. Push it back with gSystem->SetMakeSharedLib()
  4. Compiling by gSystem->CompileMacro(strb, "kfcv-", "ns_lib", "./build/aclic");

Now i can use my ns_lib.so in “run-time” without adding library path and loading CommonUtils and FuncUtils.

1 Like