I'm trying to run a piece of code in Visual Studio Code, on macOS Catalina. The code:
#include <bits/stdc++.h>
using namespace std;
int main() 
{ 
    // Create an empty vector 
    vector<int> vect;  
     
    vect.push_back(10); 
    vect.push_back(20); 
    vect.push_back(30); 
  
    for (int x : vect) 
        cout << x << " "; 
  
    return 0; 
} 
When I try to run the code using the coderunner extension, I get the error:
[Running] cd "/Users/VSC_Files/" && g++ -std=c++17 helloworld.cpp -o helloworld && "/Users/VSC_Files/"helloworld
In file included from helloworld.cpp:1:
/usr/local/include/bits/stdc++.h:57:10: fatal error: 'cstdalign' file not found
#include <cstdalign>
         ^~~~~~~~~~~
1 error generated.
[Done] exited with code=1 in 1.465 seconds
Apparently this is an error only for C++11, then why am I getting this error? I have the latest updated Xcode version and the latest stable build of VSCode too.
EDITED AND ADDED LATER
Also, I would like to add that I manually added the bits/stdc++.h file, and that it wasn't there from before.
Also, when I change g++ -std=c++17 to just g++ when running, the program runs and shows the correct output. With a warning as shown below.
helloworld.cpp:13:15: warning: range-based for loop is a C++11 extension [-Wc++11-extensions]
Is there an issue with the default C++ version in mt laptop? Please help!
 
     
     
    
 
     
     
     
    