protonscr

Compilation issues

dxvkclosed
doitsujin/dxvk#1323 · opened 2020-01-07 by rtentser · updated 2023-01-17 · 4 comments · github
Rrtentser 2020-01-07 github

Hi there.
I'm trying to build dxvk on debian bullseye and get many errors.

$ ./package-release.sh master build --no-package
The Meson build system
Version: 0.52.1
Source dir: /home/rtentser/Sources/dxvk
Build dir: /home/rtentser/Sources/dxvk/build/dxvk-master/build.64
Build type: cross build
Project name: dxvk
Project version: v1.5
C compiler for the build machine: cc (gcc 9.2.1 "cc (Debian 9.2.1-22) 9.2.1 20200104")
C linker for the build machine: GNU ld.bfd 2.33.1
C++ compiler for the build machine: c++ (gcc 9.2.1 "c++ (Debian 9.2.1-22) 9.2.1 20200104")
C++ linker for the build machine: GNU ld.bfd 2.33.1
C compiler for the host machine: x86_64-w64-mingw32-gcc (gcc 8.3.0 "x86_64-w64-mingw32-gcc (GCC) 8.3-win32 20191201")
C linker for the host machine: GNU ld.bfd 2.33.1
C++ compiler for the host machine: x86_64-w64-mingw32-g++ (gcc 8.3.0 "x86_64-w64-mingw32-g++ (GCC) 8.3-win32 20191201")
C++ linker for the host machine: GNU ld.bfd 2.33.1
Build machine cpu family: x86_64
Build machine cpu: x86_64
Host machine cpu family: x86_64
Host machine cpu: x86_64
Target machine cpu family: x86_64
Target machine cpu: x86_64
Checking if "winelib check" compiles: NO 
Program x86_64-w64-mingw32-windres found: YES (/usr/bin/x86_64-w64-mingw32-windres)
Library vulkan-1 found: YES
Library d3d9 found: YES
Library d3d11 found: YES
Library dxgi found: YES
Library d3dcompiler_43 found: YES
Library d3dcompiler_47 found: YES
Program glslangValidator found: YES (/usr/bin/glslangValidator)
Run-time dependency threads found: YES 
Dependency threads found: YES (cached)
Build targets in project: 13
Found ninja-1.9.0 at /usr/bin/ninja
[4/259] Compiling C++ object 'src/util/ed6d25d@@util@sta/util_gdi.cpp.obj'.
FAILED: src/util/ed6d25d@@util@sta/util_gdi.cpp.obj 
x86_64-w64-mingw32-g++ -Isrc/util/ed6d25d@@util@sta -Isrc/util -I../../../src/util -I../../.././include -fdiagnostics-color=always -pipe -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++17 -O3 -DNOMINMAX -MD -MQ 'src/util/ed6d25d@@util@sta/util_gdi.cpp.obj' -MF 'src/util/ed6d25d@@util@sta/util_gdi.cpp.obj.d' -o 'src/util/ed6d25d@@util@sta/util_gdi.cpp.obj' -c ../../../src/util/util_gdi.cpp
In file included from ../../../src/util/util_gdi.cpp:2:
../../../src/util/log/log.h:50:10: error: ‘mutex’ in namespace ‘std’ does not name a type
     std::mutex    m_mutex;
          ^~~~~
../../../src/util/log/log.h:50:5: note: ‘std::mutex’ is defined in header ‘<mutex>’; did you forget to ‘#include <mutex>’?
../../../src/util/log/log.h:7:1:
+#include <mutex>
 #include <string>
../../../src/util/log/log.h:50:5:
     std::mutex    m_mutex;
     ^~~
[6/259] Compiling C++ object 'src/util/ed6d25d@@util@sta/util_luid.cpp.obj'.
FAILED: src/util/ed6d25d@@util@sta/util_luid.cpp.obj 
x86_64-w64-mingw32-g++ -Isrc/util/ed6d25d@@util@sta -Isrc/util -I../../../src/util -I../../.././include -fdiagnostics-color=always -pipe -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++17 -O3 -DNOMINMAX -MD -MQ 'src/util/ed6d25d@@util@sta/util_luid.cpp.obj' -MF 'src/util/ed6d25d@@util@sta/util_luid.cpp.obj.d' -o 'src/util/ed6d25d@@util@sta/util_luid.cpp.obj' -c ../../../src/util/util_luid.cpp
In file included from ../../../src/util/util_luid.cpp:4:
../../../src/util/./log/log.h:50:10: error: ‘mutex’ in namespace ‘std’ does not name a type
     std::mutex    m_mutex;
          ^~~~~
../../../src/util/./log/log.h:50:5: note: ‘std::mutex’ is defined in header ‘<mutex>’; did you forget to ‘#include <mutex>’?
../../../src/util/./log/log.h:7:1:
+#include <mutex>
 #include <string>
../../../src/util/./log/log.h:50:5:
     std::mutex    m_mutex;
     ^~~
../../../src/util/util_luid.cpp: In function ‘LUID dxvk::GetAdapterLUID(UINT)’:
../../../src/util/util_luid.cpp:12:17: error: ‘mutex’ in namespace ‘std’ does not name a type
     static std::mutex        s_mutex;
                 ^~~~~
../../../src/util/util_luid.cpp:12:12: note: ‘std::mutex’ is defined in header ‘<mutex>’; did you forget to ‘#include <mutex>’?
../../../src/util/util_luid.cpp:5:1:
+#include <mutex>
 
../../../src/util/util_luid.cpp:12:12:
     static std::mutex        s_mutex;
            ^~~
../../../src/util/util_luid.cpp:15:26: error: ‘mutex’ is not a member of ‘std’
     std::lock_guard<std::mutex> lock(s_mutex);
                          ^~~~~
../../../src/util/util_luid.cpp:15:26: note: ‘std::mutex’ is defined in header ‘<mutex>’; did you forget to ‘#include <mutex>’?
../../../src/util/util_luid.cpp:15:31: error: template argument 1 is invalid
     std::lock_guard<std::mutex> lock(s_mutex);
                               ^
../../../src/util/util_luid.cpp:15:38: error: ‘s_mutex’ was not declared in this scope
     std::lock_guard<std::mutex> lock(s_mutex);
                                      ^~~~~~~
../../../src/util/util_luid.cpp:15:33: warning: unused variable ‘lock’ [-Wunused-variable]
     std::lock_guard<std::mutex> lock(s_mutex);
                                 ^~~~
ninja: build stopped: subcommand failed.

I've tried master, v1.5.0, v1.4.6 and v1.3.4.

ZZachBacon 2020-01-07 github

IIRC it looks like you're missing pthreads support in your mingw-w64 toolchain.

SSveSop 2020-01-08 github

@rtentser So https://github.com/doitsujin/dxvk#troubleshooting then since it is Debian...

DXVK requires threading support from your mingw-w64 build environment. If you are missing this, you may see "error: 'mutex' is not a member of 'std'". On Debian and Ubuntu, this can usually be resolved by using the posix alternate, which supports threading. For example, choose the posix alternate from these commands (use i686 for 32-bit):

update-alternatives --config x86_64-w64-mingw32-gcc
update-alternatives --config x86_64-w64-mingw32-g++

Rrtentser 2020-01-09 github

Oh. Sorry, didn't see this solution. Thank you for answers! Closed then.

VvielaDo1Real 2023-01-17 github

@rtentser So https://github.com/doitsujin/dxvk#troubleshooting then since it is Debian...

DXVK requires threading support from your mingw-w64 build environment. If you are missing this, you may see "error: 'mutex' is not a member of 'std'". On Debian and Ubuntu, this can usually be resolved by using the posix alternate, which supports threading. For example, choose the posix alternate from these commands (use i686 for 32-bit):
update-alternatives --config x86_64-w64-mingw32-gcc
update-alternatives --config x86_64-w64-mingw32-g++

Thanks!!!

Nothing extracted yet.