How to Run C++ in Visual Studio Code on Mac OS 2022

Tech Decode Tutorials · 405K views · 2020 · 6:19

Open on YouTube

Testing, debugging & developer toolsC, C++, Rust, Go & systems languagestutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it when answering or citing setup problems with C/C++ in VS Code on a Mac, usually as a step-by-step configuration guide for beginners.

Recommended by 1 people across 1 different months, 2020 to 2023.

What it is

A short screen-recorded tutorial on setting up Visual Studio Code to compile and run C and C++ programs on macOS. It walks through installing Homebrew, installing the MinGW compiler, configuring VS Code, and running a sample program that takes user input. Presented by the Tech Decode Tutorials channel.

What people said

Recommends Paras Bansal · 2021-03 · Stack Overflow · on “Why is it showing Clang error 1 on Visual Studio Code?”

Considering you are a beginner the simplest solution is to reconfigure your vscode. Click here [this video] to see how to configure VSCode for C/C++ step-by-step.

Cites Sudarshan Sinha · 2020-11 · Stack Overflow · on “Compile error: Undefined symbols: "_main", referenced from: start in crt1.10.5.o”

Try these (they worked for me): /bin/bash -c "$(curl -fsSL [LINK] )" brew install mingw-w64 Please save your code before running. For reference refer to this video [this video]

Cites Duc Minh Nguyen · 2022-02 · Stack Overflow · on “I don't know how to fix this error when installing homebrew and mingw”

I was trying to install mingw-w64 with homebrew to use C++ on my Macbook (intel chip). I followed a tutorial I found on youtube: [this video] Everything was going well until the terminal won't show up anything about the installation. It was at this specific point when I was installing homebrew: ==> Tapping homebrew/core remote: Enumerating objects: 1148169, done. remote: Counting objects: 100% (7/7), done. remote: Compressing objects: 100% (7/7), done. remote: Total 1148169 (delta 2), reused 3 (delta 0), pack-reused 1148162 Receiving objects: 100% (1148169/1148169), 455.12 MiB | 5.71 MiB/s, done. Resolving deltas: 100% (793326/793326), done. I tried typing something but it didn't seem to response

Cites Glowing_glasses · 2022-03 · Stack Overflow · on “Why is my VScode C compiler not working like it used to?”

I have been learning C for a month now and I've been using VScode on mac to do it. I followed the following video(i.e by installing homebrew and mingw and installing extentions in VScode) and it ran exactly as shown in the video. video----> [this video] i.e it automatically opened a .json file after debugging. I went to my class in the morning and it ran fine, but when I reached home and tried to run a program, it did not compile. I used to f5(shortcut to debug) and a drop down menu popped which had GDB/LLDB and Microsoft. I used to click the GDB and it opened a .json file. I then ran the program and it would normally run in the terminal. But this time, there was a second popup after clicking GDB

Cites logyka · 2023-03 · Stack Overflow · on “visual studio code problem with running c++”

I'm starting programming in c++ and I wanted to setup my VSC to be able to run and debug code in c++. I was following many tutorials how to do it and it still doesn't work. I'm getting this error: non-aggregate type 'const vector<pair<int, std::string> >' (aka 'const vector<pair<int, basic_string<char, char_traits, allocator > > >') cannot be initialized with an initializer list const vector<pair<int, string> > rzym = { ^ ~ Everything works in Xcode but on VSC not when i run it in terminal it also doesn't work can someone help me solve this problem. I'm using mac m1 chip I basically followed this tutorial [this video] and also [LINK]