网站开发赚钱吗,网站制作建设模板,建筑服务网站企业,移动网站开发教材在用vscode开发c项目的时候#xff0c;使用预先配置的CMakePresets.json可以把一些特定的cmake选项固定下来#xff0c;在配置时直接使用 cmake --config --preset presetname就可以进行配置#xff0c;免去在命令行输入过多的配置参数。
但是在vscode中#…在用vscode开发c项目的时候使用预先配置的CMakePresets.json可以把一些特定的cmake选项固定下来在配置时直接使用 cmake --config --preset presetname就可以进行配置免去在命令行输入过多的配置参数。
但是在vscode中经常会遇到找不到 cl.exe 的问题这是因为cl.exe的全局访问需要配置一些环境变量如果安装了VisualStudio之后默认就会有一个类似 Developer Powershell for VS 2022 的程序打开这个程序就会进入一个powershell命令行而且自动正确配置要使用cl.exe的环境变量。
同时要vscode的CMakeTools在 Developer Powershell中运行config步骤根据官方的提示需要从 Developer Powershell中打开vscode。 If youre a windows developer, you must open Visual Studio Code from a developer command prompt. Or, run the CMake: Scan for Compilers command before the CMake Tools extension can detect build tools (CMake, Ninja) that are installed with Visual Studio. 具体步骤如下
1. 从开始菜单中打开developer powershell 或者 developer command prompt 2. 在终端中进入项目的文件夹目录
3. 输入 code . 打开vscode
4. 然后选择需要配置的CMakePreset进行配置即可。