Open JPeterMugaas opened 1 year ago
In WSL, these libraries are made available in /usr/lib/wsl/lib
, which is added to LD_LIBRARY_PATH
automatically (unless disabled), which allows the runtime linker to find them out-of-the-box, but the static linker can't find them without additional configuration. You can add that path to the LIBRARY_PATH
environment variable (according to the comment at the top of this docs page) to get meson to actually find those libraries.
I tried #110 but that did not work when doing something like "ninja test
".
==> Starting check()...
[6/11] Linking target test/DirectX-Headers-Test
FAILED: test/DirectX-Headers-Test
c++ -o test/DirectX-Headers-Test test/DirectX-Headers-Test.p/test.cpp.o -Wl,--as-needed -Wl,--no-undefined -pie -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -Wl,--start-group libd3dx12-format-properties.a libDirectX-Guids.a -Wl,--end-group
/usr/sbin/ld: test/DirectX-Headers-Test.p/test.cpp.o: in function `main':
test.cpp:(.text.startup+0x41): undefined reference to `DXCoreCreateAdapterFactory'
/usr/sbin/ld: test.cpp:(.text.startup+0xae): undefined reference to `D3D12CreateDevice'
collect2: error: ld returned 1 exit status
My impression is that it's not able to locate the static libraries, libd3dx12-format-properties.a and libDirectX-Guids.a.
When trying to build the tests with meson, I get a problem with d3d12 not found and the tests do NOT build. I'm sure that this is NOT a linux issue because when I build with cmake in Linux, I am able to build and run the tests. Looking at the meson scripts, I have to wonder why we are looking for "d3d12" because I thought we were supposed to create it but I might be missing something.
I'm using Archlinux with wsl2. Here's the build log from my process.