How may I tell dub where to find a C library for linking?
Mike Parker
aldacron at gmail.com
Mon Dec 10 15:46:25 UTC 2018
On Monday, 10 December 2018 at 15:38:24 UTC, Pab De Nápoli wrote:
> 1) Setting the LD_LIBRARY_PATH environment variable with
>
> export LD_LIBRARY_PATH=/usr/lib/llvm-6.0/lib/
>
> and using
>
> "libs" : ["LLVM-6.0"]
>
> in dub.json. (this is somewhat nasty, it would be nice to keep
> all the information together in dub.json)
>
> Moreover, the information about the path for linking with LLVM
> can be obtained from the shell script llvconfig as
>
> $llvm-config-6.0 --libs --ldflags
> -L/usr/lib/llvm-6.0/lib
> -lLLVM-6.0
>
If you do want to put it in the dub config, the -L option, and
any linker options, can go in the "lflags" directive. "libs" is
for libraries only.
"lflags": ["-L/usr/lib/llvm-6.0/lib"],
"libs": ["LLVM-6.0"]
More information about the Digitalmars-d-learn
mailing list