cmake vscode
时间: 2023-08-26 19:16:56 浏览: 96
回答: 在使用VSCode进行CMake构建工程时,可以使用CMake插件来创建CMakeLists.txt文件和build文件夹。首先,使用快捷键Ctrl Shift P打开VSCode的控制面板,然后输入"CMake: quick start"来创建一个新的CMake项目。在创建项目时,可以选择GCC编译器,然后生成一个可执行文件。在构建工程的过程中,请确保不要删除build文件夹,否则重新建立build文件夹并运行cmake命令时会出现错误。例如,可能会出现"The CMAKE_C_COMPILER: cl is not a full path and was not found in the PATH"的错误信息。所以,需要保持build文件夹的完整性以确保构建工程的顺利进行。另外,如果需要配置项目的变体或者Kit的改变,可以通过CMake插件中的选项"cmake:variant"或者"cmake:select a kit"来实现,但需要执行cmake:configure命令才能使更改生效。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [VSCode之CMake使用](https://blog.csdn.net/dirksmaller/article/details/129619027)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [vsCode+CMake开发环境搭建](https://blog.csdn.net/weixin_43470971/article/details/119621643)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [VScode环境下使用CMake构建工程](https://blog.csdn.net/aoyousihaiqiuqihuang/article/details/127953688)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文