If you follow the official instructions for compiling Dolphin game emulation on your own, you are likely to encounter this error at the ‘make’ stage in the step 3:
dolphin/Source/Core/Common/x64CPUDetect.cpp:41:12: error: ambiguating new declaration of 'u64 _xgetbv(u32)' static u64 _xgetbv(u32 index)
This error happens because you were actually reading the instructions (as opposed to skimming through them), and did ‘git checkout tags/5.0’ to get the “stable” version. Sadly, the 5.0 version is super outdated – it was last updated in 2016.
So, you were misled by an outdated wiki page that nobody bothered to fix. Here’s how to compile Dolphin nevertheless.
# Assuming you've already created and entered the 'Build' directory, do this: cd ..; rm -rf Build # Then, switch to the main branch, where up-to-date development actually happens git checkout master git submodule update --init # just in case! might not be needed
Then, start again from the step 3 – ‘mkdir’, ‘cmake’ and all. The build should succeed.
This compiles the latest development version. It might have bugs – however, it seems to me that Dolphin has given up on releasing ‘stable’ versions. My understanding is, this is as good as you’ll get.
Nobody with access to Dolphin Wiki bothered to fix this old and quite outdated instruction. I hope that happens soon. In the meantime, this post shall serve as a guidance for anyone encountering this exact error.
If someone with editing access to Dolphin Wiki is reading this – remove the ‘checkout tags/5.0’ thing, the 5.0 tag is broken and won’t compile for anyone not running a system out of 2016.