Hi, I am a student and I wanted to include <bits/stdc++.h> file in my code so that it will help me avoid including many files in my program to save time during competitive programming, but while including above file in my program, it gives error "file not found", since clang++ do not have it present by default, so I want to add it manually. Please help me fix the issue.
I already added bits folder at this location : /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 following which I also created stdc++.h file but still error persists!!.
I also made bits folder with stdc++.h file at this location too : /Library/Developer/CommandLineTools/usr/include/c++/v1 but again couldn't fix the error!!
I also made respective changes in Homebrew folder (to fix it in g++ too, but again couldn't fix it!!)
I already added bits folder at this location … but still error persists!
Don’t modify the Xcode toolchain. If you do that, your program will stop compiling the next time you update Xcode, won’t compile if you move it between machines, and so on.
Based on this answer it seems that this file is just a header that includes a whole bunch of headers. Personally, I don’t see that adding much value. However, if you want this then the easiest option is to create your own file, MyBits.h
, that includes the headers you want to include and then, in each of your projects, add that file to the project and #include "MyBits.h"
in your source code. That’ll be both reliable and portable.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"