CLion bits/stdc++.h on macOS

I have been using CLion on macOS for competitive programming for sometime now. I recently switched to sublime text because I could get bits/stdc++.h to work with it. Having to paste many includes in my CLion template really annoys me and makes the code less readable.
If anyone has had success on getting bits/stdc++ to work with CLion on macOS could you please share your approach? There was a folder I could make to get it to work with Sublime Text but I can’t find any tutorials for CLion.
Thanks!

make a file store in the path of c++ compiler and name it as bits/stdc++.h and store all header files in it

1 Like

Try to reinstall latest mingw… And add new setup in Settings >> Build, Execution, Deployment >> Toolchains.

NOTE - Dont modify existing one. Add new one.

Use xcode, personally it’s better than Clion.
Anyways if you want to use clion you have to manually do these steps.
First open finder. Then press shift+cmd+G.

Then copy this /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/ and paste it in the box. then click Go.

When you’re in v1 folder create a new folder called bits after that create a new file called stdc++.h

Then go to this page: https://github.com/tekfyl/bits-stdc-.h-for-mac/blob/master/stdc%2B%2B.h copy the content and paste it in stdc++.h file and save it.

This will solve the problem.

you can go through it for the need

That folder doesn’t exist on my laptop, I don’t have Xcode installed…

1 Like