I recently installed VSCode to get started on C++. VSCode is installed, and I followed their guide to get started with C++: https://code.visualstudio.com/docs/cpp/config-msvc
Now when I go to build their mentioned program:
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main()
{
vector<string> msg {"Hello", "C++", "World", "from", "VS Code!"};
for (const string& word : msg)
{
cout << word << "";
}
cout << endl;
}
this is what the terminal shows:
> Executing task: clang++ -std=c++17 -stdlib=libc++ helloworld.cpp -o helloworld.out --debug <
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
The terminal process terminated with exit code: 1
Terminal will be reused by tasks, press any key to close it.
I had installed XCode too as the VSCode website told to download it as a compiler for C++ in macOS.