当前位置:网站首页>Configure vscode+cmake under win11
Configure vscode+cmake under win11
2022-06-10 08:51:00 【Itchy heart】
1. install vscode
This step , There are tutorials on the Internet .
2. download mingw-w64
3. Download and install cmake
cmake Software download
win11 64 Bit system selection latest cmake Software .





- Whether to add environment variables , Here we choose “Add CMake to the system PATH for all users”
- Whether to create a desktop shortcut icon , Depending on your situation , This is just to create desktop icons for easy use , It will not have a substantial impact on future use
Generally, it is installed in by default c disc , According to personal needs . I am going to cmake Installed in the D Plate .
The following figure shows the final confirmation of installation .


Then check whether the environment variable increases the running path of the software .
Before installing the software , Check add environment variable . After installation , An environment variable is automatically added .
Test for successful installation
cmake --version

4. stay VScode Middle configuration CMake
- First , To be in Vscode Install in cmake plug-in unit . Shortcut key Shift+Ctrl+X, Search for “cmake" and ”cmake tools“, Installation .

- CMake The main functions of the plug-in are CMake Syntax highlighting 、 Automatic completion
- CMake Tools The main function of is to combine VSCode IDE Use CMake This tool , For example, generate CMake project 、 structure CMake Items, etc.
- Shift+Ctrl+P open VSCode Command panel for , Then input cmake:q,VSCode Will automatically prompt according to the input , And then choose CMake: Quick Start
Premise : Need to open a folder.



Then choose the compiler that suits you (VSCode The compilers you installed will be listed for your choice . If you are cross compiling , Then you can configure your cross compiler here ), For the convenience of demonstration, we choose GCC 8.1.0:
Then enter the project name as prompted :
Then choose whether the project creates a library or an executable , For the convenience of demonstration, we choose the executable file Executable:
then VSCode Will generate a CMake project , As shown below :
- build The folder is
cmakeThe output folder of the instruction - Default generated
CMakeLists.txtandmain.cppfile
Running results :
5. Compile the project
cd build
cmake ..
however VSCode Provides a more convenient way ( Click on the bottom Build):
Or in VSCode From the command panel of the build command ( Input cmake after VSCode Will help you list all supported commands ):

边栏推荐
猜你喜欢

Google搜索为什么不能无限分页?

LeetCode琅琊榜第十八层-两数之和(查找表法)

Sqlserver restore failed (the database is in use and cannot gain exclusive access to the database)

AWS IOT reference example of Lexin launching esp32-c3

Rendercylinder lights for VTK learning

vtk学习之texture纹理映射

One paper second kill all permutation and combination subsets problem

微信小程序组件observers【监听器】中使用this报错undefined

The pipelineexecute pipeline execution process of VTK learning

wechat_ Configuration of wechat applet subcontracting
随机推荐
Mmsegment Series III (basic network architecture and pre training model)
【JUC系列】线程池基础使用
CString字符串分割函数
Rexroth pressure reducing valve 3dr16p5-5x/100y/00m
R语言使用epiDisplay包的mhor函数执行Cochran-Mantel-Haenszel检验并可视化、检验两个分类变量在调整(控制)第三个变量的情况下是否独立、输入数据为三维列联表
Mmsegment Series IV (custom dataset)
C#入门系列(十) -- 一维数组
Ifstream seekg() read() text operation
MMSegmention系列之五(自定义模型)
Task03:复杂一点的查询(二)
信用卡客户流失预测
uniapp将聊天页面定位始终定位到最底部展示
Pinctrl subsystem and GPIO subsystem
Sqlserver restore failed (the database is in use and cannot gain exclusive access to the database)
Vscode markdown all in One Keyboard Shortcut
Task06:秋招秘籍 B
Preparation computer database mysql +php the next day
Tenants roaming the rental complex
vscode-markdown all in one-keyboard shortcut
RunLoop的实际使用