1.Install LLVM brew install llvm@12
2.create dest.cpp
#include <bits/stdc++.h>
// code
3.when i run /opt/homebrew/opt/llvm@12/bin/clang++ dest.cpp -o dest
, i get:
fatal error: 'bits/stdc++.h' file not found
1.i add directory bits which contains a file stdc++.h to path : /opt/homebrew/Cellar/llvm@12/12.0.1_1/Toolchains/LLVM12.0.1.xctoolchain/usr/include
, i get the same fatal
2.i add it to /opt/homebrew/Cellar/llvm@12/12.0.1_1/include
too, but result is the same
PS.the stdc++.h file is correct, because I use it successful when I add it /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include
, but it does not work when i add it to llvm@12
I have to have stdc++.h here because my work is to test hundreds of codes and most of them have the stdc++.h, it is too difficult for me to change the headers to what they exactly need.
what is the trouble? is it possible to have stdc++.h while I run /opt/homebrew/opt/llvm@12/bin/clang++?