This post discusses how to use bits/stdc++.h in cpp files in OS X environment.
environment
OS X El Capitan, version 10.11.5
Xcode Version 7.3.1
what is bits/stdc++.h
This header file is very convenience since we don’t need to include other stdc++ header files. It spares the programmer time and is very useful when you need to develop tools for yourself quickly or join a programming competition. However, it increases the object size since it includes lots of other header files. So it’s better to understand the trade off while using this header file.
symptom and root cause
The gcc reports errors while the source code built includes bits/stdc++.h. The reason is that the gcc in Xcode Command Line Tools of OS X is clang rather than GNU Compiler Collection.
a solution to this error
This header file is only included in gcc(GNU Compiler Collection) but not in clang. Therefore, we need to install gcc(GNU Compiler Collection) if we want to use bits/stdc++.h. gcc(GNU Compiler Collection) shows how to install gcc(GNU Compiler Collection) in OS X.
conclusion
This posts shows that the header file bits/stdc++.h is only exclusive to gcc(GNU Compiler Collection). And we need to use GNU gcc to compile programs which use this header file.