Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

_ctermid.h: No such file or directory error on mac without Xcode

Tags:

c++

macos

gcc

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.

like image 806
mmm13 Avatar asked Oct 27 '22 14:10

mmm13


1 Answers

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

like image 163
mmm13 Avatar answered Nov 15 '22 09:11

mmm13