5

I was trying to compile my code using gcc 10.2.8 and I got this error:

scons: *** [S.os] Error 1
In file included from /usr/local/Cellar/gcc/10.2.0_2/include/c++/10.2.0/cstdio:42,
                 from Public_Library/C.h:10,
                 from Public_Library/D.h:11,
                 from Public_Library/RS.h:10,
                 from Projects/S/main.cpp:1:
/usr/local/Cellar/gcc/10.2.0_2/lib/gcc/10/gcc/x86_64-apple-darwin18/10.2.0/include-fixed/stdio.h:219:10: fatal error: _ctermid.h: No such file or directory

I found a few questions like this but the problem is I don't have Xcode on my mac and I have already updated my CommandLine tools several times and it did not work. I'm using OSX 10.14.6 by the way.

mmm13
  • 73
  • 4
  • [Have you checked this answer?](https://stackoverflow.com/questions/52509602/cant-compile-c-program-on-a-mac-after-upgrade-to-mojave/52530212#52530212) – Mike Jan 28 '21 at 10:18
  • Yes that didn't work either – mmm13 Jan 28 '21 at 17:59

1 Answers1

2

I'm just gonna add this in case it might help others. I updated my OSX to big sure and installed Xcode but that did not help. What solved the problem for me was getting an unshallow version of brew with this command: git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow

and then updating and upgrading my brew.

brew update

brew upgrade

mmm13
  • 73
  • 4