码迷,mamicode.com
首页 > 编程语言 > 详细

C++ in VSCode

时间:2020-02-19 06:02:24      阅读:88      评论:0      收藏:0      [点我收藏+]

标签:bre   soft   extension   nbsp   break   with   setting   ror   work   

# C++ in VSCode

## Extensions

- C/C++ - Microsoft
- CMake - twxs
- CMake Tools - Microsoft
- Code Runner - Jun Han [_options_]

## macOS Requirement

- Xcode
- CMake

  `brew install cmake`

## CMake

### CMake Configure

Press `Cmd+Shift+P`, input `CMake: Configure`.

### CMake Debug

1. Open `.vscode/settings.json`, append configure [_only for macOS_]

   ```json
   "cmake.debugConfig": {
        "miDebuggerPath": "${env:HOME}/.vscode/extensions/ms-vscode.cpptools-0.26.3/debugAdapters/lldb/bin/lldb-mi"
    }
   ```

2. Set a breakpoint in main, then press `Cmd+Shift+P`, input `CMake: Debug`.

## std version

```sh
# touch main.cpp
g++ -std= -o main main.cpp
```

result:

```sh
error: invalid value ‘‘ in ‘-std=‘
note: use ‘c++98‘ or ‘c++03‘ for ‘ISO C++ 1998 with amendments‘ standard
note: use ‘gnu++98‘ or ‘gnu++03‘ for ‘ISO C++ 1998 with amendments and GNU extensions‘ standard
note: use ‘c++11‘ for ‘ISO C++ 2011 with amendments‘ standard
note: use ‘gnu++11‘ for ‘ISO C++ 2011 with amendments and GNU extensions‘ standard
note: use ‘c++14‘ for ‘ISO C++ 2014 with amendments‘ standard
note: use ‘gnu++14‘ for ‘ISO C++ 2014 with amendments and GNU extensions‘ standard
note: use ‘c++17‘ for ‘ISO C++ 2017 with amendments‘ standard
note: use ‘gnu++17‘ for ‘ISO C++ 2017 with amendments and GNU extensions‘ standard
note: use ‘c++2a‘ for ‘Working draft for ISO C++ 2020‘ standard
note: use ‘gnu++2a‘ for ‘Working draft for ISO C++ 2020 with GNU extensions‘ standard
```

 

C++ in VSCode

标签:bre   soft   extension   nbsp   break   with   setting   ror   work   

原文地址:https://www.cnblogs.com/Bob-wei/p/12329615.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!