3.15是什么星座| 死鬼什么意思| 肠胃炎需要做什么检查| 1989年是什么年| 乔丹是什么品牌| 小孩子发烧是什么原因引起的| 地球什么时候毁灭| 女人脑供血不足吃什么| 1987是什么年| 小孩自闭症有什么表现| 脚侧面骨头突出叫什么| 黑色是什么颜色组成的| 黄加蓝色是什么颜色| 指甲上有竖条纹是什么原因| 皮肤癣用什么药最好| 常吃山药有什么好处和坏处| 茱萸是什么| 大象又什么又什么| o型血溶血是什么意思| 狗狗狂犬疫苗什么时候打| 荆芥是什么| 肺部ct挂什么科| 植树造林的好处是什么| 36岁属什么生肖| 碘伏和酒精有什么区别| 多子多福是什么意思| 晚上看到黄鼠狼什么预兆| 78岁属什么生肖| 天堂是什么意思| 猫可以看到什么颜色| 崩漏是什么意思| 带节奏是什么意思| 地域黑什么意思| 鹿鞭泡酒有什么功效| 染色体异常是什么原因导致的| 何曾是什么意思| 梦见以前的朋友是什么意思| 985是什么意思| 尿蛋白定量高说明什么| 阴间是什么意思| 破伤风针有什么作用| 丝芙兰属于什么档次| 耳塞戴久了有什么危害| 护理部是干什么的| art是什么| 无力感什么意思| 午餐肉是什么肉做的| 痛风吃什么消炎药| 五马分尸是什么意思| 嵌甲去医院挂什么科| 用甲硝唑栓有什么反应| 清酒和白酒有什么区别| 血沉高说明什么问题| 高粱是什么颜色| 五月11号是什么星座| 明年是什么年| 吃烧烤后吃什么水果可以帮助排毒| 为什么人会死| 九月十三是什么星座| 益生菌什么时间段吃效果好| 很容易饿是什么原因| 杨柳是什么生肖| 舌根发硬是什么原因| 三什么一什么| 神经外科主要看什么病| 打嗝用什么药| 驴友是什么意思| 酸菜鱼里面加什么配菜好吃| 铅中毒什么症状| 梦见滑雪是什么意思| 凌乱是什么意思| 低钾血症吃什么食补| 脉压是什么| 高铁列车长是什么级别| 胆碱酯酶偏高说明什么| 高血钾是什么意思| 今年65岁属什么生肖| 喝什么茶养肝护肝| 梦到发大水是什么意思| 烂仔是什么意思| tbs是什么意思| 大红袍属于什么茶类| 什么叫抗体阳性| 灌肠用什么水| 手足口病吃什么食物| med是什么意思| 十一月一号是什么星座| 癫疯病早期有什么症状| 埃及的母亲河是什么| 麂皮是什么皮| 怎么知道自己五行缺什么| 丑时是什么时间| 东北小咬是什么虫子| 压疮用什么药最快能好| 雉是什么动物| poems综合征是什么病| 行了是什么意思| 层次是什么意思| 一什么雨| 功能性消化不良是什么意思| 空调不制冷是什么原因| 嘴唇上起泡是什么原因| 刚怀孕要吃些什么好| 考试前吃什么早餐| 日新月异是什么意思| 一案双查是什么意思| 胃胀痛吃什么药| 女人什么时候停经| 中统和军统有什么区别| 骑士是什么意思| 干性湿疹用什么药膏| 艾滋病初期有什么症状| 艾蒿是什么| 鸡蛋为什么这么便宜| ca代表什么病| 海怪是什么海鲜| 胃食管反流病是什么原因造成的| 痱子是什么样的图片| 怀孕几天后有什么反应| 泻盐是什么东西| 什么时候有流星| 丙辰是什么时辰| 经常早上肚子疼是什么原因| 破伤风什么时候打最好| 琥珀色是什么颜色| 赘肉是什么意思| 排便困难是什么原因| 戊型肝炎是什么病| 一直打嗝是什么原因| 奔豚是什么意思| mrmrs是什么牌子| 绝倒是什么意思| 湿气重是什么原因引起的| 妖魔鬼怪是什么生肖| 肺气肿用什么药效果好| 肩胛骨麻麻的什么原因| 指甲上的月牙代表什么| 全脂乳粉是什么| 男性疝气是什么病| 喝什么茶可以降血脂| 甲功三项查的是什么| 嘴巴苦什么原因| 负氧离子是什么| 台风什么时候到福建| 子痫前期是什么意思| 牙齿根部发黑是什么原因| 股票加杠杆是什么意思| 孝服是什么意思| 庶子是什么意思| 智商130算什么水平| 客家人什么意思| 猪沙肝是什么部位| 阻断是什么意思| 夏天防中暑备什么药| 尿频繁什么原因| 大乌龙是什么意思| 什么叫内痔什么叫外痔| 血象高是什么意思| 橘子是什么季节的水果| ads是什么| 嘴巴里发苦是什么原因| 什么是喜欢什么是爱| 6.8什么星座| 精卫填海是什么意思| 由可以组什么词| 莅临什么意思| 林深时见鹿是什么意思| 双肾囊肿什么意思| 为什么老做梦| 嗳气打嗝吃什么药| 顺时针是什么方向| 什么虫子咬完是小红点| 女人梦到蛇预示着什么| 红枣为什么要炒黑再泡水喝| 云南白药气雾剂保险液有什么作用| 王毅什么级别| 女人出黄汗是什么原因| 小孩肚子疼拉肚子吃什么药| 利巴韦林是什么药| 香蕉为什么不能放冰箱| c反应蛋白偏高是什么原因| e代表什么方向| 春季感冒吃什么药| 乙肝两对半245阳性是什么意思| 海星吃什么食物| 骨量偏高是什么原因| 牛肉配什么菜好吃| 什么是血栓| 丝状疣挂什么科| 梦见着火是什么预兆| 石蜡病理是什么意思| 吉星高照是什么生肖| 履约是什么意思| 前列腺炎忌口什么食物| 骞是什么意思| 质数是什么| 擅长是什么意思| 吃什么水果对肝好| 勇气是什么意思| 男人鼻头有痣代表什么| 血压高吃什么药好| 牙松动了还疼用什么方法处理最好| 肝实质弥漫性回声改变什么意思| 油价什么时候上涨| kids是什么意思| 广东广西以什么为界| 不吃肉对身体有什么影响| 逆光是什么意思| 体虚是什么原因引起的| 搬新家有什么讲究和准备的| 为什么有的人怎么吃都不胖| 右耳朵疼是什么原因| 36是什么罩杯| 中暑吃什么药| 洋辣子学名叫什么| 心脏吃什么药最好| 坐骨神经吃什么药| 桂附地黄丸治什么病| 什么是贸易顺差| 脚趾缝脱皮是什么原因| 过敏挂什么科室| 人体七大营养素是什么| 我操是什么意思| 昱念什么| 深度水解奶粉是什么意思| 落魄是什么意思| 便秘什么原因引起的| prc是什么意思| 晚上吃什么有助于减肥| jps是什么意思| 奇亚籽有什么功效| 11月17是什么星座| 青岛啤酒节是什么时候| 儿童嗓子疼吃什么药好| 旦上面加一横是什么字| 茶减一笔是什么字| 干眼症吃什么药好| 万条垂下绿丝绦的上一句是什么| 功名利禄是什么意思| 白带异常吃什么药| 什么木材有香味| 什么是种植牙| 望梅止渴是什么梅| 内向的人适合什么职业| 孕妇吃什么坚果比较好| 阴道杆菌是什么意思| 肉刺长什么样子图片| 为什么会长寻常疣| 经常吃秋葵有什么好处| 73岁属什么| 悬雍垂发炎吃什么药| 惟妙惟肖是什么意思| 脖子右侧疼是什么原因| 粉盒和硒鼓有什么区别| 紫藤花什么时候开花| 桂花乌龙茶属于什么茶| 880什么意思| 哥哥的女儿叫什么| 9.3什么星座| 一代宗师是什么意思| 脂溢性脱发是什么意思| 接地气是什么意思| 一线炎是什么病严重吗| 什么叫囊肿| 百度

Try to extend agent mode in VS Code!

·朝阳区举办全民国家安全教育日主题宣传活动..

百度 这款游戏,可以由操作杆或重力控制,使小球(九九还阳丸)周游宝葫芦的每个环节,手气好的,不仅能收获一枚国学日签,还可能收获一套精美的图书。

CMake is an open-source, cross-platform tool that uses compiler and platform independent configuration files to generate native build tool files specific to your compiler and platform.

The CMake Tools extension integrates Visual Studio Code and CMake to make it easy to configure, build, and debug your C++ project.

In this tutorial, you'll use the CMake Tools extension for Visual Studio Code to configure, build, and debug a simple C++ CMake project on Linux. Aside from installing CMake, your compiler, debugger, and build tools, the steps in this tutorial apply generally to how you'd use CMake on other platforms, like Windows.

If you have any trouble, please file an issue for this tutorial in the VS Code documentation repository. Also, for more information about CMake Tools in general, see CMake Tools for Visual Studio Code documentation

Prerequisites

To complete this tutorial on Ubuntu, install the following:

  1. Visual Studio Code.

  2. C++ extension for VS Code. Install the C/C++ extension by searching for 'c++' in the Extensions view (??X (Windows, Linux Ctrl+Shift+X)).

    C/C++ extension

  3. CMake Tools extension for VS Code. Install the CMake Tools extension by searching for 'CMake tools' in the Extensions view (??X (Windows, Linux Ctrl+Shift+X)).

    CMake tools extension

  4. You'll also need to install CMake, a compiler, a debugger, and build tools.

Video: What is a build system? How do you add CMake to your project?

Watch this video to understand when a build system will help you and how to set up CMake for your project, or follow the steps in the following sections.

Ensure that CMake is installed

The VS Code CMake Tools extension does its work by using CMake installed on your system. For best results, use CMake version 3.27 or greater.

See if CMake is already installed on your system. Open a Terminal window and enter the following command:

cmake --version

To install CMake, or to get a later version if you don't at least have version 3.27, see the instructions for your platform at Kitware APT Repository. Install version 3.27 or greater.

Ensure that development tools are installed

Although you'll use VS Code to edit your source code, you'll compile and debug the source code using the compiler, debugger, and build tools (such as make) installed on your system.

For this tutorial on Ubuntu, we'll use the GCC compiler, GDB to debug, and make to build the project. These tools are not installed by default on Ubuntu, so you need to install them. Fortunately, that's easy.

Check if GCC is installed

To see if GCC is already installed on your system, open a Terminal window and enter the following command:

gcc -v

If GCC isn't installed, run the following command from the Terminal window to update the Ubuntu package lists. An out-of-date Linux distribution can interfere with getting the latest packages.

sudo apt-get update

Next, install the GNU compiler, make, and the GDB debugger with this command:

sudo apt-get install build-essential gdb

Create a CMake project

If you do not have an existing CMake project, follow the steps in Create a CMake project.

If you already have an existing CMake project that has a CMakeLists.txt file in the root directory, continue to Configure Hello World to configure your project.

Configure Hello World

Before you can use the CMake Tools extension to build a project, you need to configure it to know about the compilers on your system. There are two ways to configure CMake in VS Code:

  • Use CMake Presets (recommended)
  • Use CMake Kits/Variants

Configure using CMake Presets

We recommend using CMake Presets for managing your CMake configurations. CMake Presets enable you to specify a common JSON file, where you store all the configurations for your project. You can then share this file with others, across different IDEs, and across different operating systems.

If you created a project by following the step in Create a CMake project, your project is configured to use CMake Presets.

If your project has a CMakePresets.json file, you can use the Configure and Build presets for specifying how to build your project on your machine.

You can view the active configuration of presets in the Project Status in the CMake Tools view under the Configure and Build node. You can select these nodes at any time to set or change your Configure and Build presets.

CMake Side Panel with presets

You can also set any of your presets by running the CMake: Select Configure Preset or CMake: Select Build Preset commands in the Command Palette (??P (Windows, Linux Ctrl+Shift+P)).

CMake Select presets

Configure using CMake Kits

If your project does not have a CMakePresets.json file, you need to use kits. A kit represents a toolchain, which is the compiler, linker, and other tools used to build your project.

To scan for kits:

  1. Open the Command Palette (??P (Windows, Linux Ctrl+Shift+P)) and run CMake: Select a Kit. The extension automatically scans for kits on your computer and creates a list of compilers found on your system.

  2. Select the compiler you want to use. For example, depending on the compilers you have installed, you might see something like:

    Select the kit

    The kit you selected previously is now shown in the Project Status section in the CMake Tools view.

    Selected kit in Sidebar

To change the kit, you can select the kit in the Project Status section in the CMake Tools view, or run the CMake: Select a Kit command again from the Command Palette. If you don't see the compiler you're looking for, you can edit the cmake-tools-kits.json file in your project. To edit the file, open the Command Palette (??P (Windows, Linux Ctrl+Shift+P)) and run the CMake: Edit User-Local CMake Kits command.

Then, you'll need to select a variant.

A variant contains instructions for how to build your project. By default, the CMake Tools extension provides four variants, each corresponding to a default build type: Debug, Release, MinRelSize, and RelWithDebInfo. These options do the following:

Debug: disables optimizations and includes debug info. Release : Includes optimizations but no debug info. MinRelSize : Optimizes for size. No debug info. RelWithDebInfo : Optimizes for speed and includes debug info.

To select a variant, open the Command Palette (??P (Windows, Linux Ctrl+Shift+P)) run the CMake: Select Variant command.

Select variant

Select Debug to include debug information with your build.

Select debug variant type

The selected variant will appear in the Status bar next to the active kit.

CMake: Configure

Now that you've selected your configuration settings via presets or kits/variants, open the Command Palette (??P (Windows, Linux Ctrl+Shift+P)) and run the CMake: Configure command to configure your project. This generates build files in the project's build folder using the configurations you selected.

Build hello world

After configuring your project, you're ready to build. Open the Command Palette (??P (Windows, Linux Ctrl+Shift+P)) and run the CMake: Build command, or select the Build button from the status bar.

Build

You can select which targets you'd like to build by selecting CMake: Set Build Target from the Command Palette. By default, CMake Tools builds all targets. The selected target will appear in the Project Status view in the CMake Tools sidebar underneath the Build node and can be set from there as well.

Build Target

Debug hello world

To run and debug your project, open main.cpp and put a breakpoint on the std::cout line. Then open the Command Palette (??P (Windows, Linux Ctrl+Shift+P)) and run CMake: Debug. The debugger will stop on the std::cout line:

Debug

Go ahead and press F5 to continue.

You've now used the VS Code CMake Tools extension to use CMake to build and debug a C++ app on Ubuntu. The steps are the same for other platforms; the difference being how you install CMake and the compiler/debugger for the platform of your choice. For instructions on setting up compilers/debuggers for other platforms, see the following:

Next steps

铁观音是属于什么茶 嗓子疼喝什么 女性掉发严重是什么原因 盲盒是什么意思 ast是什么
啤酒酵母是什么 膨鱼鳃用什么搭配煲汤 清纯是什么意思 恶心反胃想吐吃什么药 哪吒的妈妈叫什么
欣喜若狂的近义词是什么 上校军衔是什么级别 免费查五行缺什么 肛门下坠感是什么原因 备孕吃叶酸有什么好处
爱情是什么感觉 儿童c反应蛋白高说明什么 什么时候测血压最准确 脆肉鲩是什么鱼 端午节为什么吃粽子
梭边鱼是什么鱼1949doufunao.com 痔疮为什么不建议手术hcv9jop0ns9r.cn 月经2个月没来是什么原因hcv7jop7ns2r.cn 端游什么意思hcv8jop2ns7r.cn 老是口干舌燥是什么原因hcv8jop5ns8r.cn
梦见好多西瓜是什么意思hcv8jop0ns9r.cn 尿液阳性是什么意思hcv7jop7ns4r.cn 界代表什么生肖hcv8jop4ns6r.cn 1941属什么生肖hcv9jop6ns0r.cn 中药什么时间喝效果最好hcv8jop6ns6r.cn
臣服什么意思hcv8jop6ns8r.cn 肚子疼是什么病hcv8jop6ns9r.cn 什么叫低钾血症hcv8jop2ns7r.cn 小肠火吃什么药效果快gysmod.com 幽门螺旋杆菌抗体阳性是什么意思hcv8jop6ns5r.cn
梦见小男孩拉屎是什么意思hcv8jop8ns2r.cn 桃花什么颜色hcv7jop7ns1r.cn 女人梦见棺材是什么征兆hcv7jop9ns4r.cn 龙根是什么hcv9jop8ns1r.cn 面试要带什么cj623037.com
百度