C++: fatal error: variant: No such file or directory


When compiling with C + + 17, you will be prompted with “fatal error: variant: no such file or directory” error;


STD:: variant is a feature of C + + 17. Although I compiled and installed gcc7.5.0, I still prompted this error
with the help of colleagues, the problem was solved because GCC did not switch to GCC 7.5.0;

apt-get install gcc-7
apt-get install gcc-7 g++-7
rm /usr/bin/g++
ln -s /usr/bin/g++-7 /usr/bin/g++


1. C + + variables doesn’t like file directories

Accounting subject

Read More: