相关疑难解决方法(0)

Visual Studio代码includePath

我正在尝试在Visual Studio Code中构建C/C++.我安装了C/C++和所有相关的扩展.

#include <stdio.h>
int main() {
    printf("Test C now\n");
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

但是在#include <stdio.h>"添加包含设置路径" 下面有一条绿线.当我单击它时,它会移动到"c_cpp_properties.json".

我可以在下面的配置中添加包含路径的方式和位置?

"configurations": [
    {
        "name": "Mac",
        "includePath": ["/usr/include"]
    }
]
Run Code Online (Sandbox Code Playgroud)

c c++ visual-studio-code

51
推荐指数
4
解决办法
14万
查看次数

使用某些选项为CMake配置Visual Studio代码

我想使用CMake工具扩展在Visual Studio Code中开发CMake项目。

我使用以下命令在命令行中构建项目:

PS project\build> cmake -G"Visual Studio 14 2015 Win64" -DBOOST_ROOT=some\path -DQT_ROOT=another\path\ project\path
Run Code Online (Sandbox Code Playgroud)

如何在.cmaketools.json文件.vscode夹下的文件中使用相同的选项设置相同的命令?我想从编辑器内部运行它,如果可能的话,还指定输出文件夹,而不是build在我的项目中创建一个文件夹。

这是我的实际.cmaketools.json:

{
  "variant": {
    "label": "Debug",
    "keywordSettings": {
      "buildType": "debug"
    },
    "description": "Emit debug information without performing optimizations"
  },
  "activeEnvironments": [
    "Visual C++ 14.0 - amd64"
  ]
}
Run Code Online (Sandbox Code Playgroud)

cmake visual-studio-code

3
推荐指数
1
解决办法
8998
查看次数

标签 统计

visual-studio-code ×2

c ×1

c++ ×1

cmake ×1