Skip to content
Minsing Log
Go back

English Edition

Setting up a Mac VS Code development environment

Programming & CS

[Neiseuhan’s explanation]

+ Let’s add an auto save feature too!

Parts where I got unfairly screwed over

1. The result only appears in the terminal after saving

There were cases where I created a cpp file but didn’t save it, so the result didn’t appear. It has to be saved for the changes to take effect. After getting tripped up by this, I configured auto save in the settings.

2. Code Runner Extension Setting that caused me trouble while debugging

In Code Runner’s executor map, there is a section called set the executor of each language. There is a part here where you modify settings.json, and I set the g++ compiler version to c++14 after referring to a blog post from 2021. As a result, the next step, configuring and running debugging mode, did not work properly. It seems to have been a version issue. So I changed the setting to c++17.

"cpp": "cd $dir && g++ -std=c++17 *.cpp -o $fileNameWithoutExt && $dir$fileNameWithoutExt",

After that, I could see that the Run button in the code file now included debugging functionality too! Nice.

Just as described on the internet, the build of the active file with clang++ appears.

Then, the task.json file that I had been searching for, wondering why it wouldn’t work, was generated. For a more accurate explanation, let’s follow the Neiseuhan’s explanation guide

공개 여정 구독

글이 올라오면 이메일로 보내드릴게요.

개발, 창업, 배움, 실패와 회고를 짧고 솔직하게 기록합니다. 검색으로 스쳐가는 독자가 아니라 여정을 따라오는 팬을 만들기 위한 뉴스레터입니다.

뉴스레터는 준비 중입니다. 그동안 RSS 로 구독하거나 이메일 로 알림을 요청해 주세요.


Share this post:

Comments

Sign in with GitHub to leave a comment.


Previous Post
The GOAT Recursive Algorithm: Euclid’s Algorithm
Next Post
What is a YAML file?