Emulator Issues #12765
closedDolphin fails to build on Linux x86_64, depends on std::all_of() which is only implemented in C++11
0%
Description
Dolphin is now failing to build on Linux x86_64, because std::all_of() is not defined in the C++ version used by the Dolphin build system. It may be time to migrate to C++11 or find an alternative for all_of().
Attached are the cmake and make logs for my build attempt. This issue seems to have appeared in commit f4e2d369c0 ("Merge pull request #10270 from Pokechu22/header-order", 2021-12-12), which is when my builds started failing. I track the master branch available on GitHub so the actual issue may have appeared further back in the branch created by that PR.
I'm not immediately sure what I can do to rectify this, otherwise I would have made a pull request. I'm not the most familiar with the emulator source and I don't want to break something from lack of familiarity, but if I find an obvious solution I'll make a PR later. If the issue is because of user error, be sure to let me know :)
I also will post direct terminal dumps if needed, since what I've posted here is just logs captured via redirection (> / 2>).
Thanks in advance.
Files
Updated by JosJuice about 3 years ago
We started using C++11 a long time ago, and Dolphin's build system is currently set to use C++17: https://github.com/dolphin-emu/dolphin/blob/66fc335c1198a05fe1df3e6b86f973fb31da96b7/Source/CMakeLists.txt#L25
But, if it worked before and it doesn't work now, I guess something is indeed wrong in Dolphin's source code or build system files.
Updated by ssdsnake about 3 years ago
Hi nkeck72,
Could you provide which distribution you are running?
Thank you
Updated by ssdsnake about 3 years ago
ssdsnake wrote:
Hi nkeck72,
Could you provide which distribution you are running?
Thank you
(I was able to build this about 12 hours ago from master, also on x86_64, so curious why it failed for you)
Updated by nkeck72 about 3 years ago
Note: I also compiled this using make -j16. Using single-threaded make, even from a fresh clone, doesn't solve the problem. Because the logs were captured from the -j16 run, it may be a bit difficult to read, so allow me to post the actual error message here.
[ 52%] Building CXX object Source/Core/Core/CMakeFiles/core.dir/NetPlayCommon.cpp.o
/home/noah/sources/dolphin/Source/Core/Core/NetPlayCommon.cpp: In function ‘bool NetPlay::DecompressPacketIntoFolderInternal(sf::Packet&, const string&)’:
/home/noah/sources/dolphin/Source/Core/Core/NetPlayCommon.cpp:238:14: error: ‘all_of’ is not a member of ‘std’
238 | if (std::all_of(name.begin(), name.end(), [](char c) { return c == '.'; }))
| ^~~~~~
make[2]: *** [Source/Core/Core/CMakeFiles/core.dir/build.make:3002: Source/Core/Core/CMakeFiles/core.dir/NetPlayCommon.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1534: Source/Core/Core/CMakeFiles/core.dir/all] Error 2
make: *** [Makefile:156: all] Error 2
Updated by nkeck72 about 3 years ago
ssdsnake wrote:
Hi nkeck72,
Could you provide which distribution you are running?
Thank you
I am running Arch Linux, with all packages up to date as of 11AM this morning (12/15/21).
Updated by ssdsnake about 3 years ago
nkeck72 wrote:
ssdsnake wrote:
Hi nkeck72,
Could you provide which distribution you are running?
Thank you
I am running Arch Linux, with all packages up to date as of 11AM this morning (12/15/21).
ok, thanks. I'll spin up a VM tonight and see if I can reproduce it.
Updated by AdmiralCurtiss about 3 years ago
NtePlayCommon.cpp
is probably missing an #include <algorithm>
...
Updated by nkeck72 about 3 years ago
JosJuice wrote:
Yes, it does. Will fix.
Thanks. Not sure why I didn't check that :P
In any case, I will pull the PR's branch and see if that fixes it.
Updated by JosJuice about 3 years ago
- Status changed from Accepted to Fix pending
Updated by nkeck72 about 3 years ago
The build now works as expected. Thanks for the prompt response. :)
Updated by leoetlino about 3 years ago
- Status changed from Fix pending to Fixed
- Fixed in set to 5.0-15617