DEV Community

justVikram
justVikram

Posted on

How To Include ‘bits/stdc++.h’ Header File With Clang Compiler on macOS

I have written a comprehensive article on how you can use the infamous bits/stdc++.h header file with Clang compiler in the same way as you would use any standard header file. Please give it a read.
Link to Medium Article

TLDR
Download the linked file. Go to /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1 and copy the downloaded file to that directory. You can start using #include <stdcpp.h> in your projects instead of manually including all required header files.

Top comments (1)

Collapse
 
pauljlucas profile image
Paul J. Lucas • Edited
  1. Anything in the bits directory is for the implementation and it not supposed to be included by your end project.
  2. You shouldn't be modifying anything inside the Xcode.app directory. Whenever you upgrade, that directory will be overwritten anyway.
  3. Always including everything slows compilation times way down.
  4. Assuming you want to write portable code, just #include what you're supposed to include.

This is simply bad advice.

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay