Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 97371

How do I build and compile C++ in VSCode?

$
0
0

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.


Viewing all articles
Browse latest Browse all 97371

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>