Hi, I'm a mac user. Recently I tried to run code on terminal, but this error appeared.
ans.cpp:1:10: fatal error: 'bits/stdc++.h' file not found
include <bits/stdc++.h>
^~~~~~~~~~~~~~~
1 error generated.
I then searched for solutions and found out that installing gcc with homebrew would work, so I installed gcc.
But it still showed the same error, Can anyone help me find out why?
Thank you
Auto comment: topic has been updated by guagua0407 (previous revision, new revision, compare).
Auto comment: topic has been updated by guagua0407 (previous revision, new revision, compare).
Auto comment: topic has been updated by guagua0407 (previous revision, new revision, compare).
This one has helped me out.
The command for compilation using gcc is g++-11. g++ defaults to clang on MacOS.
Here's the general compilation command :
g++-11 -std=c++17
Thanks, this worked!
Maybe the include path does not have the gcc library? I faced a similar issue and my include path was not set up properly for some reason.
sad