Visual Studio Code

原创
2016/11/28 18:05
阅读数 1W

1.安装cpptools插件

2.安装 code runner插件

3.安装 native debug 插件,用于gdb图形化调试你的C/C++程序

Visual Studio Code 和GCC共同调试C/C++程序

调试C/C++程序

添加头文件索引路径。在hello.c中,你会发现include头文件那一行下面有红色色的波浪线,代表vs code的cpptools插件找不到相应路径,将鼠标移到这一行点击。 

"configurations": [{
            "name": "Mac",
            "includePath": [
                "${workspaceRoot}",
...
                "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/*"
            ],
            "defines": [],
            "browse": {
                "path": [
                    "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1",
                    "/usr/local/include",
                    "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/8.1.0/include",
                    "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include",
                    "/usr/include"
                ],
                "limitSymbolsToIncludedHeaders": true,
                "databaseFilename": ""
            }
        },

注意,本人Xcode自带的gcc头文件路径

"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/*"

展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部