I am getting the following error when I try to execute c++ code
In file included from /usr/local/Cellar/gcc/10.2.0_3/include/c++/10.2.0/bits/postypes.h:40,
from /usr/local/Cellar/gcc/10.2.0_3/include/c++/10.2.0/iosfwd:40,
from /usr/local/Cellar/gcc/10.2.0_3/include/c++/10.2.0/ios:38,
from /usr/local/Cellar/gcc/10.2.0_3/include/c++/10.2.0/ostream:38,
from /usr/local/Cellar/gcc/10.2.0_3/include/c++/10.2.0/iostream:39,
from main.cpp:1:
/usr/local/Cellar/gcc/10.2.0_3/include/c++/10.2.0/cwchar:44:10: fatal error: wchar.h: No such file or directory
44 | #include <wchar.h>
| ^~~~~~~~~
compilation terminated.
I am using gcc10 on MacOS Big Sur 11.2 The compiler was working fine till I updated homebrew or updated to Big Sur 11.2. Running brew cleanup could've also broken it. I have tried unlinking and linking gcc again but that had no effect. What can I do to fix this error? Would it be better to delete and reinstall gcc?