N Kaushik

Fix- MacOS GCC error cannot open source file '_stdio.h' (dependency of 'stdio.h')

April 19, 2021

MacOS GCC error cannot open source file ‘_stdio.h’ (dependency of ‘stdio.h’):

This error was raised with gcc on MacOS Big Sur. It normally comes if you are trying to compile any file using gcc. For example, if you are trying to compile a C program, using gcc:

gcc example.c

This error might be thrown.

gcc error can't open file stdio.h

Fix for this issue:

This issue was resolved after reinstalling xcode-select. Use the below command to reinstall it:

xcode-select --install

If it not fixed, you can try to run the .c file directly from XCode. XCode will detect if there is any dependency left to download and it will install it and this should be fixed.


Subscribe to my Newsletter

© 2021, nkaushik