protonscr

ninja: build stopped: subcommand failed - 'remove_if' is not a member of 'std'

dxvkclosed bugbuild
doitsujin/dxvk#4183 · opened 2024-07-31 by ericzlmd · updated 2024-08-31 · 5 comments · github
1 matching comments, n / p to jump
Eericzlmd 2024-07-31 github

Hello!

I'm trying to compile dxvk from source, and I encountered the following.

OS: Fedora 40, kernel-6.11

[299/303] Compiling C++ object src/d3d9/d3d9.dll.p/d3d9_mem.cpp.obj
FAILED: src/d3d9/d3d9.dll.p/d3d9_mem.cpp.obj 
i686-w64-mingw32-g++ -Isrc/d3d9/d3d9.dll.p -Isrc/d3d9 -I../../src/d3d9 -I../../include -I../../include/vulkan/include -I../../include/spirv/include -fdiagnostics-color=always -D_GLIBCXX_ASSERTIONS=1 -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=c++17 -O3 -msse -msse2 -msse3 -mfpmath=sse -Wimplicit-fallthrough -Wno-missing-field-initializers -Wno-unused-parameter -Wno-cast-function-type -Wno-unused-const-variable -Wno-missing-braces -DNOMINMAX -D_WIN32_WINNT=0xa00 -DDXVK_WSI_WIN32 -MD -MQ src/d3d9/d3d9.dll.p/d3d9_mem.cpp.obj -MF src/d3d9/d3d9.dll.p/d3d9_mem.cpp.obj.d -o src/d3d9/d3d9.dll.p/d3d9_mem.cpp.obj -c ../../src/d3d9/d3d9_mem.cpp
../../src/d3d9/d3d9_mem.cpp: In member function 'void dxvk::D3D9MemoryAllocator::FreeChunk(dxvk::D3D9MemoryChunk*)':
../../src/d3d9/d3d9_mem.cpp:52:25: error: 'remove_if' is not a member of 'std'; did you mean 'remove_cv'?
   52 |     m_chunks.erase(std::remove_if(m_chunks.begin(), m_chunks.end(), [&](auto& item) {
      |                         ^~~~~~~~~
      |                         remove_cv
[300/303] Compiling C++ object src/d3d8/d3d8.dll.p/d3d8_shader.cpp.obj
ninja: build stopped: subcommand failed.

Adding the following to src/d3d9/d3d9_mem.cpp seems to have fixed this compile issue:

#include <algorithm>

Ddoitsujin maintainer 2024-08-01 github

Which build environment is this on?

Eericzlmd 2024-08-01 github

Hi there. Sorry I just updated the post to include the following

Pparona-source 2024-08-17 github

This is most likely a gcc-14 change with it removing implicit header includes. They do this almost every major release with a header or two.

https://gcc.gnu.org/gcc-14/porting_to.html

BBlisto91 2024-08-20 github

Feel free to make a PR with the extra include

Eericzlmd 2024-08-30 github

Thank you. Learned a lot today. :bow:

DLLs