How to create meson.build with external libs?

p.shkadzko p.shkadzko at gmail.com
Mon Jan 13 21:15:51 UTC 2020


On Monday, 13 January 2020 at 20:53:43 UTC, p.shkadzko wrote:
> On Monday, 13 January 2020 at 19:56:35 UTC, p.shkadzko wrote:
>> On Monday, 13 January 2020 at 17:14:29 UTC, p.shkadzko wrote:
>>> [...]
>>
>> I had to set PKG_CONFIG_PATH to "/usr/local/lib/pkgconfig". 
>> For some reason Manjaro distro doesn't have it set by default. 
>> After setting the pkgconfig path, lubeck is getting found and 
>> everything works.
>
> After I ran "meson build" I got the following output:
> -----------------------
> The Meson build system
> Version: 0.52.1
> Source dir: /home/tastyminerals/dev/test_proj
> Build dir: /home/tastyminerals/dev/test_proj/build
> Build type: native build
> Project name: mir_quickstart
> Project version: 0.1
> D compiler for the host machine: ldc2 (llvm 1.18.0 "LDC - the 
> LLVM D compiler (1.18.0):")
> D linker for the host machine: GNU ld.gold 2.33.1
> Host machine cpu family: x86_64
> Host machine cpu: x86_64
> Found pkg-config: /usr/bin/pkg-config (1.6.3)
> Run-time dependency mir-algorithm found: YES 3.4.0
> Run-time dependency lubeck found: YES 1.0.0
> Build targets in project: 1
> Found ninja-1.9.0 at /usr/bin/ninja
>
> I then cd to build/ dir and run "ninja"
> ------------------------
> [2/2] Linking target test_proj.tart at exe/app.d.o'.
>
> But when I try to run compiled app.d file as demo_run, I get:
> ------------------------
> ./demo_run: error while loading shared libraries: 
> libmir-algorithm.so: cannot open shared object file: No such 
> file or directory
>
> I thought that if meson builds and finds the external libs 
> successfully and ninja links everything, all should be fine. I 
> don't understand. Why the compiled file cannot find the 
> external library?

$LD_LIBRARY_PATH was not set to "/usr/local/lib" where 
libmir-algorithm.so is located. I had to set it explicitly and 
recompile the project but then I get another error message:

./demo_proj: error while loading shared libraries: 
subprojects/mir-algorithm/libmir-algorithm.so.3.4.0: cannot open 
shared object file: No such file or directory


(ಠ_ಠ)


More information about the Digitalmars-d-learn mailing list