I am trying to compile against a library but it is not finding it:
error while loading shared libraries: liboccutils.so: cannot open shared object file: No such file or directory
I am using:
{.passL: "-L/usr/local/lib/ -loccutils".}
The file /usr/local/lib/liboccutils.so exists and using LD_LIBRARY_PATH works:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
So I am probably misusing passL.
You need to add -Wl,-rpath to linker options.
const libPath = "/usr/local/lib"
const libName =) "-loccutils"
{.passL: "-L" & libPath}
{.passL: "-Wl,-rpath," & libPath}
{.passL: "-l" & libName}
Thanks a lot. It worked.
For the record, just fixing a few typos:
const libPath = "/usr/local/lib"
const libName = "occutils"
{.passL: "-L" & libPath.}
{.passL: "-Wl,-rpath," & libPath.}
{.passL: "-l" & libName.}