<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>NotionNext BLOG</title>
        <link>https://tangly1024.com/</link>
        <description>这是一个由NotionNext生成的站点</description>
        <lastBuildDate>Mon, 21 Aug 2023 03:07:20 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>zh-CN</language>
        <copyright>All rights reserved 2023, 小·暖·屋</copyright>
        <item>
            <title><![CDATA[基于VSCode和CMake实现的C/C++开发-Linux篇]]></title>
            <link>https://tangly1024.com/article/vscode-linux7</link>
            <guid>https://tangly1024.com/article/vscode-linux7</guid>
            <pubDate>Mon, 14 Aug 2023 00:00:00 GMT</pubDate>
            <description><![CDATA[B站VSCode-Linux课程七讲课件]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-f9699b0a267b4df383a5325089a57dca"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-blank notion-block-78058c50722949f68c2a7884961a3a64"> </div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-9309312882de4c94be35857b9b67c91f" data-id="9309312882de4c94be35857b9b67c91f"><span><div id="9309312882de4c94be35857b9b67c91f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#9309312882de4c94be35857b9b67c91f" title="本次课程适合的对象："><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>本次课程适合的对象：</b></span></span></h3><ul class="notion-list notion-list-disc notion-block-767241705fb94fd2926def15ff626f63"><li>Linux零基础，想了解最常用的<b>高频Linux命令</b>的小伙伴</li></ul><ul class="notion-list notion-list-disc notion-block-28de7ea916da4c059945926f50b38b17"><li>只会在Windows开发C/C++，需要转<b>Linux</b>开发的小伙伴</li></ul><ul class="notion-list notion-list-disc notion-block-fde6330219f24d1f979184db32851b08"><li>想深入了解并掌握<b>GCC</b>编译器编译语法和规则的小伙伴</li></ul><ul class="notion-list notion-list-disc notion-block-b28387eed082429cae5a52f1ef293317"><li>想深入了解并掌握<b>GDB</b>调试器命令行调试的小伙伴</li></ul><ul class="notion-list notion-list-disc notion-block-552a9dad8b9f4760a135f987c74fbfd5"><li>想学习使用<b>CMake</b>构建<b>C/C++</b>工程的小伙伴</li></ul><ul class="notion-list notion-list-disc notion-block-309d6b7c8e2240428b5290236b3d7467"><li>想学习Linux下使用<b>VSCode</b>进行<b>C/C++</b>开发的小伙伴</li></ul><div class="notion-text notion-block-53363265013649d9aeac307909a8da55">总而言之，本课程将<b>从零开始，教会你如何在Linux开发C/C++</b>，带领你一起打开新世界的大门~</div><blockquote class="notion-quote notion-block-1853ccb5359945bc8d3131e52c8ecfe8"><div>系统环境：Ubuntu18.04 LTS  虚拟机</div><div class="notion-text notion-block-c636a93c1f0f4b08b4c93338eceec4d6">开发语言：<b>C++</b></div><div class="notion-text notion-block-80ccad3f8c5944898a36617539a8c78c">开发IDE  ：<b>VSCode</b></div></blockquote><div class="notion-text notion-block-448b2558d0e34d448457d2e74add5893">课程宗旨：<em>无干货，不视频。分享让生活更美好。</em></div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-c74fe55cc62e46df949ce1c1eb5b2eb7" data-id="c74fe55cc62e46df949ce1c1eb5b2eb7"><span><div id="c74fe55cc62e46df949ce1c1eb5b2eb7" class="notion-header-anchor"></div><a class="notion-hash-link" href="#c74fe55cc62e46df949ce1c1eb5b2eb7" title="第一讲："><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>第一讲：</b></span></span></h3><div class="notion-text notion-block-7360fed0fc4a40bc9cf865449e4e276c"><b>什么是linux系统？</b></div><ul class="notion-list notion-list-disc notion-block-643c0b5c088244428af79177026e871e"><li>Linux是<b>开源</b>的操作系统</li></ul><div class="notion-text notion-block-4b59e1a3864e46a48c897e1fdad2f291"><b>多用户多任务：</b></div><ul class="notion-list notion-list-disc notion-block-e03b58f959164c9898f9ea1f32ddbb09"><li>单用户：一个用户，在登录计算机（操作系统），只能允许<b>同时</b>登录一个用户；</li></ul><ul class="notion-list notion-list-disc notion-block-6a80d25356d84606a5aebf1746b3d481"><li>单任务：一个任务，允许用户<b>同时</b>进行的操作任务数量；</li></ul><ul class="notion-list notion-list-disc notion-block-f29983fef989471b8fabe2747d0a3baa"><li>多用户：多个用户，在登录计算机（操作系统），允许<b>同时</b>登录多个用户进行操作；</li></ul><ul class="notion-list notion-list-disc notion-block-12c36f8008484e3ca2244b696226e4c6"><li>多任务：多个任务，允许用户<b>同时</b>进行多个操作任务；</li></ul><div class="notion-text notion-block-e360f381820c4a1eba2fa0702cbe6707"><b>Windows</b>属于：单用户、多任务。</div><div class="notion-text notion-block-8a5e1f56200747fe86b95eb46062a6aa"><b>Linux</b>属于：多用户、多任务。</div><div class="notion-text notion-block-12e9214e4a8748f8aa381ce586d6b729"><b>Linux一切皆文件</b></div><div class="notion-text notion-block-d4331ba022754642aa79cafa1adf7859">对于文件的操作的都有哪些种类？</div><ul class="notion-list notion-list-disc notion-block-6061195fb9ff47f5aee553b61c489a44"><li><b>创建文件、编辑文件、保存文件、关闭文件、重命名文件、删除文件、恢复文件。</b></li></ul><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-e307cc200e58454e82a2cc3b6acda238" data-id="e307cc200e58454e82a2cc3b6acda238"><span><div id="e307cc200e58454e82a2cc3b6acda238" class="notion-header-anchor"></div><a class="notion-hash-link" href="#e307cc200e58454e82a2cc3b6acda238" title="1.1 目录结构"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>1.1 目录结构</b></span></span></h4><div class="notion-text notion-block-561ad6dc86ce40f39e5ed5861b15facf"><b>目录结构：</b></div><ul class="notion-list notion-list-disc notion-block-6f4d1ad1aaae48629d718ca258935712"><li><b>Bin：</b>全称binary，含义是二进制。该目录中存储的都是一些二进制文件，文件都是可以被运行的。</li></ul><ul class="notion-list notion-list-disc notion-block-4a7a9bb8cc3d4289a2d1c367cfbe0742"><li><b>Dev：该目录中主要存放的是外接设备，例如盘、其他的光盘等。在其中的外接设备是不能直接被使用的，需要挂载（类似window</b>下<b>的分配盘符）。</b></li></ul><ul class="notion-list notion-list-disc notion-block-02ff3da8faee427499774b05af624a5e"><li><b>Etc：</b>该目录主要存储一些配置文件。</li></ul><ul class="notion-list notion-list-disc notion-block-5b2cc19833a144f597190b7aa7bdef8e"><li><b>Home：</b>表示“家”，表示<b>除了root用户以外</b>其他用户的家目录，类似于windows下的User/用户目录。</li></ul><ul class="notion-list notion-list-disc notion-block-d28e51ab730743419bcc1483387beba1"><li><b>Proc：</b>全称process，表示进程，该目录中存储的是Linux运行时候的进程。</li></ul><ul class="notion-list notion-list-disc notion-block-15567e0fd05443ab8cc9c83c219fea1c"><li><b>Root：</b>该目录是root用户自己的家目录。</li></ul><ul class="notion-list notion-list-disc notion-block-2830a9f9da694eec800411f68a1b4452"><li><b>Sbin：</b>全称super binary，该目录也是存储一些可以被执行的二进制文件，但是必须得有super权限的用户才能执行。</li></ul><ul class="notion-list notion-list-disc notion-block-4b9c52ce7a4641168bd02af8ca1a74db"><li><b>Tmp：</b>表示“临时”的，当系统运行时候产生的临时文件会在这个目录存着。</li></ul><ul class="notion-list notion-list-disc notion-block-d1c46b5020db4601a47e923d98185df7"><li><b>Usr：</b>存放的是用户自己安装的软件。类似于windows下的program files。</li></ul><ul class="notion-list notion-list-disc notion-block-6d3fc505cc6140549e0d1ab854a648e1"><li><b>Var：</b>存放的程序/系统的日志文件的目录。</li></ul><ul class="notion-list notion-list-disc notion-block-63d69f0f29974ca78c6c1389af2a4434"><li><b>Mnt：</b>当外接设备需要挂载的时候，就需要挂载到mnt目录下。</li></ul><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-36c955a28535490e8170849864ced427" data-id="36c955a28535490e8170849864ced427"><span><div id="36c955a28535490e8170849864ced427" class="notion-header-anchor"></div><a class="notion-hash-link" href="#36c955a28535490e8170849864ced427" title="1.2 指令与选项"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>1.2 指令与选项</b></span></span></h4><ul class="notion-list notion-list-disc notion-block-95c7bb7705a1479c8bdf7d835fd243fd"><li><b>指令含义：</b></li></ul><ul class="notion-list notion-list-disc notion-block-d7a61963d294437cb35ba6b5ee1ca173"><li><b>Linux的指令</b>是指在Linux<b>终端（命令行）</b>中输入的内容。</li></ul><ul class="notion-list notion-list-disc notion-block-670d99ebefa944a1ba6d68946039f6af"><li><b>指令格式：</b></li><ul class="notion-list notion-list-disc notion-block-670d99ebefa944a1ba6d68946039f6af"><li>完整指令的<b>标准格式</b>：<b>命令</b>（空格） [<b>选项</b>]（空格） [<b>操作对象</b>]</li><li>选项和操作对象都可以没有，也可以是多个</li></ul></ul><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-a087314468dc4e07b968f3c47a754cc3" data-id="a087314468dc4e07b968f3c47a754cc3"><span><div id="a087314468dc4e07b968f3c47a754cc3" class="notion-header-anchor"></div><a class="notion-hash-link" href="#a087314468dc4e07b968f3c47a754cc3" title="1.3 重要指令讲解 +【实战】命令行演练"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>1.3 重要指令讲解 +【实战】命令行演练</b></span></span></h4><ul class="notion-list notion-list-disc notion-block-96757cbe460b49c8ae7dcfaee1e00787"><li><b>pwd</b> - <b>Print current working directory</b></li><ul class="notion-list notion-list-disc notion-block-96757cbe460b49c8ae7dcfaee1e00787"><li><b>作用：</b>打印当前终端所在的目录</li><li><b>用法： pwd</b></li></ul></ul><ul class="notion-list notion-list-disc notion-block-470ebd0cb4f14aa9976bb4d338be0ea2"><li><b>ls - List directory contents</b></li><ul class="notion-list notion-list-disc notion-block-470ebd0cb4f14aa9976bb4d338be0ea2"><li><b>作用：</b>列出当前工作目录下的所有文件/文件夹的名称</li><li><b>用法1：ls</b></li><ul class="notion-list notion-list-disc notion-block-abf280ec16284af5911790fc1fb34dbf"><div class="notion-text notion-block-60101be094304445a2a9c0671e05c25c"><b>含义：</b>列出当前工作目录下的文件/文件夹的名称</div></ul><li><b>用法2：ls [路径]</b></li><ul class="notion-list notion-list-disc notion-block-c86c0202c6f1409cae6368abc2c1b2cc"><div class="notion-text notion-block-730b2e22cb4248798a01dfc67221947b"><b>含义：</b>列出指定<b>路径</b>下的所有文件/文件夹的名称</div><li>绝对路径：相对<b>根目录</b>的路径；</li><li>相对路径：相对<b>当前目录</b>的路径；</li></ul><li><b>用法3：ls [选项] [路径]</b></li><ul class="notion-list notion-list-disc notion-block-8aedacb457604fccbbd92da205b1f68f"><div class="notion-text notion-block-f256f84e78d249b6815bcb86a23b30d2"><b>含义：</b>在列出指定路径下的文件/文件夹的名称，并以指定的格式进行显示。</div></ul></ul></ul><ul class="notion-list notion-list-disc notion-block-c9870678d6d243fbb95b1793f73dfaa3"><li><b>cd - change directory</b></li><ul class="notion-list notion-list-disc notion-block-c9870678d6d243fbb95b1793f73dfaa3"><li><b>作用：</b>切换当前的工作目录</li><li><b>用法1：cd ； cd ~</b></li><li><b>用法2：cd [相对路径]</b></li><li><b>用法3：cd [绝对路径]</b></li></ul></ul><ul class="notion-list notion-list-disc notion-block-8a92c418008f42f9b3e3f1c830fddb89"><li><b>mkdir - make directories</b></li><ul class="notion-list notion-list-disc notion-block-8a92c418008f42f9b3e3f1c830fddb89"><li><b>作用：</b>创建目录</li><li><b>用法1：mkdir 路径</b></li><li><b>用法2：mkdir -p 路径</b></li><ul class="notion-list notion-list-disc notion-block-5f6f54ac8d8e4dca857984204a1fa047"><div class="notion-text notion-block-8194d6cc02b04d43bce303d3cfa2924b"><b>含义：</b>一次性创建多层不存在的目录</div></ul><li><b>用法3：mkdir 路径1 [路径2] [路径3]</b></li><ul class="notion-list notion-list-disc notion-block-61a062a7d66947f3980c87945683a485"><div class="notion-text notion-block-1658c34a421e474bb4b498e262681b8b"><b>含义：</b>一次性创建多个目录</div></ul></ul></ul><ul class="notion-list notion-list-disc notion-block-daaeac7ec41f44e7887e4b583e11c97c"><li><b>touch - change file timestamps</b></li><ul class="notion-list notion-list-disc notion-block-daaeac7ec41f44e7887e4b583e11c97c"><li><b>作用：</b>创建新文件</li><li><b>用法1：touch [路径]</b></li><li><b>用法2：touch [路径1] [路径2]</b></li></ul></ul><ul class="notion-list notion-list-disc notion-block-81b46e8d8e8b47eaaf61ad88563f54a6"><li><b>rm - remove files or directories</b></li><ul class="notion-list notion-list-disc notion-block-81b46e8d8e8b47eaaf61ad88563f54a6"><li><b>作用：</b>删除文件/目录</li><li><b>用法1：rm [选项] 需要移除的文件路径</b></li><li><b>用法2：rm [选项] 需要移除的目录</b></li></ul></ul><ul class="notion-list notion-list-disc notion-block-848a87a5b1b64db7870225db7fe7dc05"><li><b>cp - copy files and directories</b></li><ul class="notion-list notion-list-disc notion-block-848a87a5b1b64db7870225db7fe7dc05"><li><b>作用：</b>复制文件/文件夹到指定的位置</li><li><b>用法1：cp [被复制的文件路径] [文件被复制到的路径]</b></li><li><b>用法2：cp -r [被复制的文件夹路径] [文件夹被复制到的路径]*</b></li><ul class="notion-list notion-list-disc notion-block-085bb786958a41eda6db712d48882276"><div class="notion-text notion-block-f894d7de326a4d3b8ea5732626debd8c"><b>含义：</b>-r 表示递归复制，复制文件夹的时候需要加 -r</div></ul><li><b>用法3：mkdir [路径1] [路径2] [路径3]</b></li><ul class="notion-list notion-list-disc notion-block-4b4ce78e258a4f4cbe8c0eba7685b961"><div class="notion-text notion-block-922ae148dc4b457da85b13f9d83e480e"><b>含义：</b>一次性创建多个目录</div></ul></ul></ul><ul class="notion-list notion-list-disc notion-block-8e346b2711ba42e8b8e31306ac5621b6"><li><b>mv - move (rename) files</b></li><ul class="notion-list notion-list-disc notion-block-8e346b2711ba42e8b8e31306ac5621b6"><li><b>作用：</b>移动文件到新的位置，或者重命名文件</li><li><b>用法：mv [需要移动的文件路径] [需要保存的位置路径]</b></li></ul></ul><ul class="notion-list notion-list-disc notion-block-d97a7b3b4d604930b9017cd076e0cc1b"><li><b>man - an interface to the system reference manuals</b></li><ul class="notion-list notion-list-disc notion-block-d97a7b3b4d604930b9017cd076e0cc1b"><li><b>作用：</b>包含了Linux中全部命令手册</li><li><b>用法：man [命令]</b></li><li><b>含义：</b>查看命令使用手册，按 q 退出</li><hr class="notion-hr notion-block-776aefd76c444e968ff7c2e72ccebf39"/></ul></ul><ul class="notion-list notion-list-disc notion-block-a1288d6da031471aaa8f56b57888fb42"><li><b>reboot - reboot the machine</b></li><ul class="notion-list notion-list-disc notion-block-a1288d6da031471aaa8f56b57888fb42"><li><b>作用：</b>重启linux系统</li><li><b>用法：reboot</b></li></ul></ul><ul class="notion-list notion-list-disc notion-block-c08e0d3ca1d84fc4a850a5b6731cbdd8"><li><b>shutdown - power-off the machine</b></li><ul class="notion-list notion-list-disc notion-block-c08e0d3ca1d84fc4a850a5b6731cbdd8"><li><b>作用：</b>关机</li><li><b>用法：shut -h [时间]</b></li></ul></ul><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-29a8f97b75b044c1bd1d2ebaedc78c9f" data-id="29a8f97b75b044c1bd1d2ebaedc78c9f"><span><div id="29a8f97b75b044c1bd1d2ebaedc78c9f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#29a8f97b75b044c1bd1d2ebaedc78c9f" title="1.4 文件编辑"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>1.4 文件编辑</b></span></span></h4><ul class="notion-list notion-list-disc notion-block-cb974a446098406fb3f6d2eb0dd2313b"><li><b>Vim [file]</b></li><ul class="notion-list notion-list-disc notion-block-cb974a446098406fb3f6d2eb0dd2313b"><li>所有的 Linux系统都会内建 Vi/Vim编辑器，其他的编辑器则不一定会存在</li><li>Vim是所有Unix及Linux系统下标准的编辑器</li><li><b>Vim 具有程序开发的能力，也可以用来对文件进行简单的编辑</b></li><div class="notion-text notion-block-bfaf4b862cba4c48ba55980b75bf8090"><b>Vim具有“编辑器之神”的称号</b>，学会Vim便可在Linux的世界里<b>畅行无阻</b>，<b>尤其是在终端中</b>。</div><div class="notion-text notion-block-e79b1aee6a8d46bdb5e8815fd23584ae">👇Vim操作终极图片👇</div></ul></ul><ul class="notion-list notion-list-disc notion-block-4073efc2f62e4607801465213ad05a99"><li><b>gedit [file]</b></li><ul class="notion-list notion-list-disc notion-block-4073efc2f62e4607801465213ad05a99"><li>Linux 下的一个纯文本编辑器</li><li>可以根据不同的语言高亮显现关键字和标识符。</li></ul></ul><ul class="notion-list notion-list-disc notion-block-561c9432cfea4d98a2a07670a495b494"><li><b>nano [file]</b></li><ul class="notion-list notion-list-disc notion-block-561c9432cfea4d98a2a07670a495b494"><li>nano 是一个小巧的文本编辑器</li><li>它比vi/vim要简单得多，比较适合Linux初学者使用。</li><li>某些Linux发行版的默认编辑器就是nano。</li></ul></ul><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-3bb2d357fa3c4ca998e269f038b13a15" data-id="3bb2d357fa3c4ca998e269f038b13a15"><span><div id="3bb2d357fa3c4ca998e269f038b13a15" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3bb2d357fa3c4ca998e269f038b13a15" title="第二讲：开发环境搭建"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>第二讲：开发环境搭建</b></span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-380f53a341c3470e93396909752b6c07" data-id="380f53a341c3470e93396909752b6c07"><span><div id="380f53a341c3470e93396909752b6c07" class="notion-header-anchor"></div><a class="notion-hash-link" href="#380f53a341c3470e93396909752b6c07" title="2.1 编译器，调试器安装"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>2.1 编译器，调试器安装</b></span></span></h4><ul class="notion-list notion-list-disc notion-block-4408852c271248acb71f2bb1ed09f189"><li><b>安装GCC，GDB</b></li></ul><ul class="notion-list notion-list-disc notion-block-2ebd3c69005d428399144ac621ffab22"><li><b>安装成功确认</b></li></ul><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-8c0185a805cf412b96e1253085be11a5" data-id="8c0185a805cf412b96e1253085be11a5"><span><div id="8c0185a805cf412b96e1253085be11a5" class="notion-header-anchor"></div><a class="notion-hash-link" href="#8c0185a805cf412b96e1253085be11a5" title="2.2 CMake安装"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>2.2 CMake安装</b></span></span></h4><ul class="notion-list notion-list-disc notion-block-de51e8244535437587a3080b7761206c"><li><b>安装cmake</b></li></ul><ul class="notion-list notion-list-disc notion-block-67d2e9904a16419bb7745535867d4cec"><li><b>安装成功确认</b></li></ul><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-49cb102236af46a6b63c529737a228af" data-id="49cb102236af46a6b63c529737a228af"><span><div id="49cb102236af46a6b63c529737a228af" class="notion-header-anchor"></div><a class="notion-hash-link" href="#49cb102236af46a6b63c529737a228af" title="第三讲：GCC编译器"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>第三讲：GCC编译器</b></span></span></h3><div class="notion-text notion-block-4bc2d33a2e124c8babfa5e56214afa6a"><b>前言</b>：</div><ol start="1" class="notion-list notion-list-numbered notion-block-ac15b37c5f6841df91adf80489d7e16c"><li>GCC 编译器支持编译 Go、Objective-C，Objective-C ++，Fortran，Ada，D 和 BRIG（HSAIL）等程序；</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-7135af15a46744fc9d2d4ef3b74d4ad5"><li>Linux 开发C/C++ 一定要熟悉 GCC</li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-6f55b39e6c5243a291a929e774c1f8e1"><li><b>VSCode是通过调用GCC编译器来实现C/C++的编译工作的；</b></li></ol><div class="notion-text notion-block-5ada3359d6cb48e68b617c3cc1389f20">实际使用中：</div><ul class="notion-list notion-list-disc notion-block-abb51d04bba040fd9274c2d590310c14"><li>使用 gcc 指令编译 C 代码</li></ul><ul class="notion-list notion-list-disc notion-block-ca6156459c414f8c9067d01325eaf3b5"><li>使用 g++指令编译 C++ 代码</li></ul><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-56c00f9870fa4a58a89fa0d459b968d0" data-id="56c00f9870fa4a58a89fa0d459b968d0"><span><div id="56c00f9870fa4a58a89fa0d459b968d0" class="notion-header-anchor"></div><a class="notion-hash-link" href="#56c00f9870fa4a58a89fa0d459b968d0" title="3.1 编译过程"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>3.1 编译过程</b></span></span></h4><ol start="1" class="notion-list notion-list-numbered notion-block-d978ad6eb59647599de1bdfdf1ec8c0c"><li><b>预处理-Pre-Processing	//.i文件</b></li></ol><ol start="1" class="notion-list notion-list-numbered notion-block-830d2a458c8c44539d3920f81240a914"><li><b>编译-Compiling	// .s文件</b></li></ol><ol start="1" class="notion-list notion-list-numbered notion-block-6dd0a92055b14885beae395492588580"><li><b>汇编-Assembling	// .o文件</b></li></ol><ol start="1" class="notion-list notion-list-numbered notion-block-dee8f015c65e49288cc3c13342a14818"><li><b>链接-Linking	// bin文件</b></li></ol><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-16abbef8ca2846569fddfba3486c0dc3" data-id="16abbef8ca2846569fddfba3486c0dc3"><span><div id="16abbef8ca2846569fddfba3486c0dc3" class="notion-header-anchor"></div><a class="notion-hash-link" href="#16abbef8ca2846569fddfba3486c0dc3" title="3.2 g++重要编译参数"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>3.2 g++重要编译参数</b></span></span></h4><ol start="1" class="notion-list notion-list-numbered notion-block-18cc5eabfa4345e8b5b2c47485583dbd"><li><b>g</b>	编译带调试信息的可执行文件</li></ol><ol start="1" class="notion-list notion-list-numbered notion-block-e1fe029222b1453c87577eedbbacb85a"><li><b>O[n]</b>	优化源代码</li></ol><ol start="1" class="notion-list notion-list-numbered notion-block-80108bc3c9d24d3ca336bef175386fb1"><li><b>l 和 -L</b>	指定库文件 | 指定库文件路径</li></ol><ol start="1" class="notion-list notion-list-numbered notion-block-f08fb1597e744d05918f0e3007404c9a"><li><b>I</b>	指定头文件搜索目录</li></ol><ol start="1" class="notion-list notion-list-numbered notion-block-67502b5fc19d4bc9bf88affa91cbbc4b"><li><b>Wall</b>	打印警告信息</li></ol><ol start="1" class="notion-list notion-list-numbered notion-block-5fce6691d436457da3bf8dd72c0ff2e1"><li><b>w</b>	关闭警告信息</li></ol><ol start="1" class="notion-list notion-list-numbered notion-block-79bb616f578848328c1a75290e2f5a6e"><li><b>std=c++11</b>	设置编译标准</li></ol><ol start="1" class="notion-list notion-list-numbered notion-block-7a29596b1a5e4588ad41d0fc9147b1a5"><li><b>o</b>	指定输出文件名</li></ol><ol start="1" class="notion-list notion-list-numbered notion-block-f111625c4c574c2289958d72e8398494"><li><b>D</b>	定义宏</li></ol><div class="notion-text notion-block-902fd061449a4b61943f4f0e5e3edf13">示例代码：</div><div class="notion-text notion-block-5bac003ba1304e19a63b645c583dc5b7">注：使用 <code class="notion-inline-code">man gcc</code>命令可以查看gcc英文使用手册，见下图</div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-8a1662643a6a4eb5a4b5589c7c3a41ba" data-id="8a1662643a6a4eb5a4b5589c7c3a41ba"><span><div id="8a1662643a6a4eb5a4b5589c7c3a41ba" class="notion-header-anchor"></div><a class="notion-hash-link" href="#8a1662643a6a4eb5a4b5589c7c3a41ba" title="3.3 【实战】g++命令行编译"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>3.3 【实战】g++命令行编译</b></span></span></h4><div class="notion-text notion-block-820be01100094dd98b5f5abbdaae7b0c"><b>案例：</b>最初目录结构: 2 directories, 3 files</div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-b3655acb263c468a8b31ac4003421dfa" data-id="b3655acb263c468a8b31ac4003421dfa"><span><div id="b3655acb263c468a8b31ac4003421dfa" class="notion-header-anchor"></div><a class="notion-hash-link" href="#b3655acb263c468a8b31ac4003421dfa" title="3.3.1 直接编译"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>3.3.1 直接编译</b></span></span></h4><div class="notion-text notion-block-c5676da97c02454bba98b29b3c1cd8c8"><b>最简单的编译，并运行</b></div><div class="notion-text notion-block-35ab634e19fa423399b9928759fa064d"><b>增加参数编译，并运行</b></div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-b9cf2e4413d44e959544fd66ef3bef23" data-id="b9cf2e4413d44e959544fd66ef3bef23"><span><div id="b9cf2e4413d44e959544fd66ef3bef23" class="notion-header-anchor"></div><a class="notion-hash-link" href="#b9cf2e4413d44e959544fd66ef3bef23" title="3.3.2 生成库文件并编译"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>3.3.2 生成库文件并编译</b></span></span></h4><hr class="notion-hr notion-block-e2060753084d491085a4bd8a3ae705c3"/><div class="notion-text notion-block-bedd637b01874de7bad2d20e8bf05a67">链接<b>静态库</b>生成可执行文件①：</div><div class="notion-text notion-block-b625760d3fef432f81a7b9a3cd7a7eff">链接<b>动态库</b>生成可执行文件②：</div><div class="notion-text notion-block-f1637a60484b4c5ab3a8710b5a39db67"><b>编译完成后的目录结构</b></div><hr class="notion-hr notion-block-9449c3a848494cf480567ed0e6d8eda2"/><div class="notion-text notion-block-3754877af9794d93bb1246925fbdde25">最终目录结构：2 directories, 8 files</div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-9c64b88285c142d18cf52b17aa19bc32" data-id="9c64b88285c142d18cf52b17aa19bc32"><span><div id="9c64b88285c142d18cf52b17aa19bc32" class="notion-header-anchor"></div><a class="notion-hash-link" href="#9c64b88285c142d18cf52b17aa19bc32" title="3.3.3 运行可执行文件"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>3.3.3 运行可执行文件</b></span></span></h4><hr class="notion-hr notion-block-dcd04db4bed9488188246f35a0c8ecd9"/><div class="notion-text notion-block-2b642333b42245e992d3b65637019888">运行可执行文件①</div><div class="notion-text notion-block-fa78b59da24b48d098689bdbdc2fc13e">运行可执行文件②</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-2e333cb1fdf24a0caeba0edbbc717876" data-id="2e333cb1fdf24a0caeba0edbbc717876"><span><div id="2e333cb1fdf24a0caeba0edbbc717876" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2e333cb1fdf24a0caeba0edbbc717876" title="第四讲：GDB调试器"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>第四讲：GDB调试器</b></span></span></h3><div class="notion-text notion-block-938919ac996e4cfa9b8c158df13ef82b"><b>前言：</b></div><ul class="notion-list notion-list-disc notion-block-e8caa19bf4ae4fc098b5c7770eb6b285"><li><b>GDB(GNU Debugger)</b>是一个用来<b>调试C/C++程序</b>的功能强大的<b>调试器</b>，是Linux系统开发C/C++最常用的调试器</li></ul><ul class="notion-list notion-list-disc notion-block-15bd4248091c4977b5062e0692c0fa88"><li>程序员可以<b>使用GDB来跟踪程序中的错误</b>，从而减少程序员的工作量。</li></ul><ul class="notion-list notion-list-disc notion-block-0b5fa6628d584861a4aa049fcd0d0eab"><li>Linux 开发C/C++ 一定要熟悉 GDB</li></ul><ul class="notion-list notion-list-disc notion-block-16d99d356d2e4e4ea892d456740e538c"><li><b>VSCode是通过调用GDB调试器来实现C/C++的调试工作的；</b></li></ul><blockquote class="notion-quote notion-block-2b55ac765e534a2ba631ef316b048a5c"><div>Windows 系统中，常见的集成开发环境（IDE），如 VS、VC等，它们内部已经嵌套了相应的调试器</div></blockquote><div class="notion-text notion-block-7a8d369a5bde432e9b6169c7b866b12d"><b>GDB主要功能：</b></div><ul class="notion-list notion-list-disc notion-block-d8730a26af2c43e5807486897234cc05"><li>设置<b>断点</b>(断点可以是条件表达式)</li></ul><ul class="notion-list notion-list-disc notion-block-6d678f47af4340e38aceafbb893d5bb1"><li>使程序在指定的代码行上暂停执行，便于观察</li></ul><ul class="notion-list notion-list-disc notion-block-bd0e583cc04b4f1e9b1e62c24e7736d1"><li><b>单步</b>执行程序，便于调试</li></ul><ul class="notion-list notion-list-disc notion-block-04c89c3290b943f193f4ab93e8adb340"><li>查看程序中变量值的变化</li></ul><ul class="notion-list notion-list-disc notion-block-a13c77f1e3a84ac496efadaef250b5f0"><li>动态改变程序的执行环境</li></ul><ul class="notion-list notion-list-disc notion-block-bf5f5468fd1f4b65b6038de2ff59f6a7"><li>分析崩溃程序产生的core文件</li></ul><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-fbc8ebf01209464594caae246ab99ae7" data-id="fbc8ebf01209464594caae246ab99ae7"><span><div id="fbc8ebf01209464594caae246ab99ae7" class="notion-header-anchor"></div><a class="notion-hash-link" href="#fbc8ebf01209464594caae246ab99ae7" title="4.1 常用调试命令参数"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>4.1 常用调试命令参数</b></span></span></h4><div class="notion-text notion-block-4487c1f9b82d472e94224d83192a1738">调试开始：执行<b>gdb [exefilename]</b> ，进入gdb调试程序，其中exefilename为要调试的可执行文件名</div><blockquote class="notion-quote notion-block-2156eb6be328402783e0fa2ca403e91d"><div>Tips:</div><ol start="1" class="notion-list notion-list-numbered notion-block-f4980c181dcb4f8db420c2c8eda3c498"><li>编译程序时需要加上-g，之后才能用gdb进行调试：gcc -g main.c -o main</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-d2a2765bd1ae424c8fa8c3e5c3a7d076"><li>回车键：重复上一命令</li></ol></blockquote><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-d8259c10c5b04b4396c20453d03c198f" data-id="d8259c10c5b04b4396c20453d03c198f"><span><div id="d8259c10c5b04b4396c20453d03c198f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#d8259c10c5b04b4396c20453d03c198f" title="4.2 【实战】命令行调试"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>4.2 【实战】命令行调试</b></span></span></h4><div class="notion-text notion-block-1f08634b44f04c29809e68f324a4adca">给出一段简单代码，准备调试。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-35a45cbaaae84a41974d08548be2f0d2" data-id="35a45cbaaae84a41974d08548be2f0d2"><span><div id="35a45cbaaae84a41974d08548be2f0d2" class="notion-header-anchor"></div><a class="notion-hash-link" href="#35a45cbaaae84a41974d08548be2f0d2" title="第五讲：IDE - VSCode"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>第五讲：IDE - VSCode</b></span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-06e5f9f35ba34321b659a46671ee5bb9" data-id="06e5f9f35ba34321b659a46671ee5bb9"><span><div id="06e5f9f35ba34321b659a46671ee5bb9" class="notion-header-anchor"></div><a class="notion-hash-link" href="#06e5f9f35ba34321b659a46671ee5bb9" title="5.1 界面介绍"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>5.1 界面介绍</b></span></span></h4><ol start="1" class="notion-list notion-list-numbered notion-block-a6ebcb5cd4b54ecd8e31defcdb48eca6"><li>侧边栏</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-bd45ce9477e5432a83b41d648d601cdc"><li>菜单栏</li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-85780149af8e4fe1a50e4fb8d1ad9e07"><li>编辑区</li></ol><ol start="4" class="notion-list notion-list-numbered notion-block-db42bb0add804f5cbf4bf5d01d61227b"><li>状态栏</li></ol><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-4e2f6e2452194399a4c38be10369ac00" data-id="4e2f6e2452194399a4c38be10369ac00"><span><div id="4e2f6e2452194399a4c38be10369ac00" class="notion-header-anchor"></div><a class="notion-hash-link" href="#4e2f6e2452194399a4c38be10369ac00" title="5.2 插件安装"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>5.2 插件安装</b></span></span></h4><div class="notion-text notion-block-d6f0c80b436e495ba8548e8fd28efa82">以下三款插件是在Linux下开发C/C++的三款必备插件~</div><ul class="notion-list notion-list-disc notion-block-fe50169e28a64975a84c17f874d429b0"><li>C/C++</li></ul><ul class="notion-list notion-list-disc notion-block-c951e65d2e7547bfbddcdc9724655e76"><li>CMake</li></ul><ul class="notion-list notion-list-disc notion-block-48200fc2f57a45cba1cd14e2bb6cd401"><li>CMake Tools</li></ul><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-be66d55f614c457cbdf543fcc268679f" data-id="be66d55f614c457cbdf543fcc268679f"><span><div id="be66d55f614c457cbdf543fcc268679f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#be66d55f614c457cbdf543fcc268679f" title="5.3 快捷键"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>5.3 快捷键</b></span></span></h4><div class="notion-text notion-block-8e0db782968249fe8e22e41491b47e44"><b>高频使用快捷键：</b></div><table class="notion-simple-table notion-block-d177f35034844de39196c15d060de56d"><tbody><tr class="notion-simple-table-row notion-block-e35ee10c4de04b229e3c4d4949893c0c"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>功能</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>快捷键</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>功能</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>快捷键</b></div></td></tr><tr class="notion-simple-table-row notion-block-84706c6b62774f02ac29dc99e44393ff"><td class="" style="width:120px"><div class="notion-simple-table-cell">转到文件 / 其他常用操作</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">Ctrl + P</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">关闭当前文件</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">Ctrl + W</code></div></td></tr><tr class="notion-simple-table-row notion-block-5e9217113fce4be799c5e7b37b227ab8"><td class="" style="width:120px"><div class="notion-simple-table-cell">打开命令面板</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">Ctrl + Shift + P</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">当前行上移/下移</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">Alt + Up/Down</code></div></td></tr><tr class="notion-simple-table-row notion-block-19d1f290ee694fab944c18b978e74c31"><td class="" style="width:120px"><div class="notion-simple-table-cell">打开终端</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">Ctrl +`</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">变量统一重命名</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">F2</code></div></td></tr><tr class="notion-simple-table-row notion-block-0c2ee140d63f465eb39548c2baf0c51c"><td class="" style="width:120px"><div class="notion-simple-table-cell">关闭侧边栏</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">Ctrl + B</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">转到定义处</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">F12</code></div></td></tr><tr class="notion-simple-table-row notion-block-f4a8ec93324d4ab6b754ee0243703d7e"><td class="" style="width:120px"><div class="notion-simple-table-cell">复制文本</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">Ctrl+C</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">粘贴文本</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">Ctrl+V</code></div></td></tr><tr class="notion-simple-table-row notion-block-541a567378e54bdfaa24bd22753e0344"><td class="" style="width:120px"><div class="notion-simple-table-cell">保存文件</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">Ctrl+S</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">撤销操作</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">Ctrl+Z</code></div></td></tr></tbody></table><hr class="notion-hr notion-block-9fbfcc3353a7468aabecaa501394d4f5"/><div class="notion-text notion-block-e2f2f572941540368568a94ee56aee1f"><b>在 </b><code class="notion-inline-code"><b>Ctrl+P</b></code><b> 窗口下还可以:</b></div><ul class="notion-list notion-list-disc notion-block-01fea16ab7724b5a99c7666eced599e7"><li>直接输入文件名，跳转到文件</li></ul><ul class="notion-list notion-list-disc notion-block-8592debedfee4613baf6fbfa7729a2cb"><li><code class="notion-inline-code">?</code> 列出当前可执行的动作</li></ul><ul class="notion-list notion-list-disc notion-block-462689e4f01e499dbb64a5d68185a869"><li><code class="notion-inline-code">!</code> 显示 <code class="notion-inline-code">Errors</code>或 <code class="notion-inline-code">Warnings</code>，也可以 <code class="notion-inline-code">Ctrl+Shift+M</code></li></ul><ul class="notion-list notion-list-disc notion-block-f926dd4b93ee43e78ebb3407850e9e47"><li><code class="notion-inline-code">:</code> 跳转到行数，也可以 <code class="notion-inline-code">Ctrl+G</code> 直接进入</li></ul><ul class="notion-list notion-list-disc notion-block-f92bc5fc80a5415c9ea169c297a7ee29"><li><code class="notion-inline-code">@</code> 跳转到 <code class="notion-inline-code">symbol</code>（搜索变量或者函数），也可以 <code class="notion-inline-code">Ctrl+Shift+O</code> 直接进入</li></ul><ul class="notion-list notion-list-disc notion-block-78951c1b6d0e49348eb850db2731d21a"><li><code class="notion-inline-code">@</code> 根据分类跳转 <code class="notion-inline-code">symbol</code>，查找属性或函数，也可以 <code class="notion-inline-code">Ctrl+Shift+O</code> 后输入:进入</li></ul><ul class="notion-list notion-list-disc notion-block-193528520c7a4c70a0dd09d71f733dfd"><li><code class="notion-inline-code">#</code> 根据名字查找 <code class="notion-inline-code">symbol</code>，也可以 <code class="notion-inline-code">Ctrl+T</code></li></ul><div class="notion-text notion-block-332be84fb134451bbcfe812f89036168"><b>快捷键：编辑器与窗口管理</b></div><ol start="1" class="notion-list notion-list-numbered notion-block-74f9d754be4c4b0cb19124bf6a1589f5"><li>打开一个新窗口： <code class="notion-inline-code">Ctrl+Shift+N</code></li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-92716288342442559b72553e3c59d3f6"><li>关闭窗口： <code class="notion-inline-code">Ctrl+Shift+W</code></li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-00da906fd452458c85f7b3a43b694f6b"><li>同时打开多个编辑器（查看多个文件）</li></ol><ol start="4" class="notion-list notion-list-numbered notion-block-25be774e0d6c48d29d77946f09838589"><li>新建文件 <code class="notion-inline-code">Ctrl+N</code></li></ol><ol start="5" class="notion-list notion-list-numbered notion-block-77b8eca223de48e8b5fd1338959dbb0d"><li>文件之间切换 <code class="notion-inline-code">Ctrl+Tab</code></li></ol><ol start="6" class="notion-list notion-list-numbered notion-block-263c6d55b81946d8bd2868f643d37b9d"><li>切出一个新的编辑器（最多 <code class="notion-inline-code">3</code> 个） <code class="notion-inline-code">Ctrl+\</code>，也可以按住 <code class="notion-inline-code">Ctrl</code> 鼠标点击 <code class="notion-inline-code">Explorer</code> 里的文件名</li></ol><ol start="7" class="notion-list notion-list-numbered notion-block-641ec73bd9b1428295b1901a7f4ee55e"><li>左中右 <code class="notion-inline-code">3</code> 个编辑器的快捷键 <code class="notion-inline-code">Ctrl+1</code> <code class="notion-inline-code">Ctrl+2</code> <code class="notion-inline-code">Ctrl+3</code></li></ol><ol start="8" class="notion-list notion-list-numbered notion-block-442a764417b54b5dadd869bfa5978bbb"><li><code class="notion-inline-code">3</code> 个编辑器之间循环切换 <code class="notion-inline-code">Ctrl+</code></li></ol><ol start="9" class="notion-list notion-list-numbered notion-block-df1d4903356047bab3f1e50769d83906"><li>编辑器换位置， <code class="notion-inline-code">Ctrl+k</code>然后按 <code class="notion-inline-code">Left</code>或 <code class="notion-inline-code">Right</code></li></ol><div class="notion-text notion-block-caadd069cd6c4fa4a70e084404336f00"><b>↓ 代码编辑相关的快捷键 ↓</b></div><div class="notion-text notion-block-111afc022deb460395f077ccd8e4869a"><b>快捷键：格式调整</b></div><ol start="1" class="notion-list notion-list-numbered notion-block-741a7a536e814062acd8b97b15182577"><li>代码行缩进 <code class="notion-inline-code">Ctrl+[</code> 、 <code class="notion-inline-code">Ctrl+]</code></li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-d53308460b8247ab8a516b7512ad93b9"><li><code class="notion-inline-code">Ctrl+C</code> 、 <code class="notion-inline-code">Ctrl+V</code> 复制或剪切当前行/当前选中内容</li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-84fb7a7ada304a53a955fc030e6154d7"><li>代码格式化： <code class="notion-inline-code">Shift+Alt+F</code>，或 <code class="notion-inline-code">Ctrl+Shift+P</code> 后输入 <code class="notion-inline-code">format code</code></li></ol><ol start="4" class="notion-list notion-list-numbered notion-block-18137f46b04b477687a4ec269c5508dc"><li>上下移动一行： <code class="notion-inline-code">Alt+Up</code> 或 <code class="notion-inline-code">Alt+Down</code></li></ol><ol start="5" class="notion-list notion-list-numbered notion-block-03fca45a29744d9ebbb9e43d5f8be3f8"><li>向上向下复制一行： <code class="notion-inline-code">Shift+Alt+Up</code> 或 <code class="notion-inline-code">Shift+Alt+Down</code></li></ol><ol start="6" class="notion-list notion-list-numbered notion-block-97de02b420b848759570ad9cc822b9d6"><li>在当前行下边插入一行 <code class="notion-inline-code">Ctrl+Enter</code></li></ol><ol start="7" class="notion-list notion-list-numbered notion-block-413dc6c47933486788427be0bbf96cfa"><li>在当前行上方插入一行 <code class="notion-inline-code">Ctrl+Shift+Enter</code></li></ol><div class="notion-text notion-block-ebac6ab266d9439e9e8df29ebdbc6f2e"><b>快捷键：光标相关</b></div><ol start="1" class="notion-list notion-list-numbered notion-block-2f3a4a2e292d4cfd84359a671dc3166d"><li>移动到行首： <code class="notion-inline-code">Home</code></li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-68baf0e4e88746938a1f6dc4191fdc6b"><li>移动到行尾： <code class="notion-inline-code">End</code></li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-1d3c5712b3ce401aa1b028bc79d52e4a"><li>移动到文件结尾： <code class="notion-inline-code">Ctrl+End</code></li></ol><ol start="4" class="notion-list notion-list-numbered notion-block-d434e87d7cf448099d6eadaf289243e0"><li>移动到文件开头： <code class="notion-inline-code">Ctrl+Home</code></li></ol><ol start="5" class="notion-list notion-list-numbered notion-block-9adc1332550d4d2eb31058347545a303"><li>移动到定义处： <code class="notion-inline-code">F12</code></li></ol><ol start="6" class="notion-list notion-list-numbered notion-block-0c832a48f47e433ba6cc3a009dc018ae"><li>定义处缩略图：只看一眼而不跳转过去 <code class="notion-inline-code">Alt+F12</code></li></ol><ol start="7" class="notion-list notion-list-numbered notion-block-0da1f384d9d9450faaccc1ce3c7bc162"><li>移动到后半个括号： <code class="notion-inline-code">Ctrl+Shift+]</code></li></ol><ol start="8" class="notion-list notion-list-numbered notion-block-cbc77b50811d4263833121257b223a4d"><li>选择从光标到行尾： <code class="notion-inline-code">Shift+End</code></li></ol><ol start="9" class="notion-list notion-list-numbered notion-block-b84b4dce20d64605b0bef438f14b95a4"><li>选择从行首到光标处： <code class="notion-inline-code">Shift+Home</code></li></ol><ol start="10" class="notion-list notion-list-numbered notion-block-1b09767c190943fca8e6d34e1189a261"><li>删除光标右侧的所有字： <code class="notion-inline-code">Ctrl+Delete</code></li></ol><ol start="11" class="notion-list notion-list-numbered notion-block-61c97aeba29c45bea512cfc7e07acf35"><li>扩展/缩小选取范围： <code class="notion-inline-code">Shift+Alt+Left</code> 和 <code class="notion-inline-code">Shift+Alt+Right</code></li></ol><ol start="12" class="notion-list notion-list-numbered notion-block-7731fd7639364ee88118676f83cb7162"><li>多行编辑(列编辑)：<code class="notion-inline-code">Alt+Shift+鼠标左键</code>，<code class="notion-inline-code">Ctrl+Alt+Down/Up</code></li></ol><ol start="13" class="notion-list notion-list-numbered notion-block-02fcbe635e5f4ca3813229cd961b1001"><li>同时选中所有匹配： <code class="notion-inline-code">Ctrl+Shift+L</code></li></ol><ol start="14" class="notion-list notion-list-numbered notion-block-0ffb13db74e24deb9c64f1c47fa1ee95"><li><code class="notion-inline-code">Ctrl+D</code> 下一个匹配的也被选中 (在 sublime 中是删除当前行，后面自定义快键键中，设置与 <code class="notion-inline-code">Ctrl+Shift+K</code> 互换了)</li></ol><ol start="15" class="notion-list notion-list-numbered notion-block-1abf071466194760b4630dfb17e91a5d"><li>回退上一个光标操作： <code class="notion-inline-code">Ctrl+U</code></li></ol><div class="notion-text notion-block-8b2af0f4523d4833a557874710306742"><b>快捷键：重构代码</b></div><ol start="1" class="notion-list notion-list-numbered notion-block-66456799204f4c9794165a814639aed2"><li>找到所有的引用： <code class="notion-inline-code">Shift+F12</code></li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-41dfb5fc9e4b4ea3aa6a7e0431824c4e"><li>同时修改本文件中所有匹配的： <code class="notion-inline-code">Ctrl+F12</code></li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-4af82debf1cc4930a7d2570b1bf46fd6"><li>重命名：比如要修改一个方法名，可以选中后按 <code class="notion-inline-code">F2</code>，输入新的名字，回车，会发现所有的文件都修改了</li></ol><ol start="4" class="notion-list notion-list-numbered notion-block-2937a687839046e5af527c65d1b142a8"><li>跳转到下一个 <code class="notion-inline-code">Error</code> 或 <code class="notion-inline-code">Warning</code>：当有多个错误时可以按 <code class="notion-inline-code">F8</code> 逐个跳转</li></ol><ol start="5" class="notion-list notion-list-numbered notion-block-f07ba429f19f4295a27e825ed41ceccf"><li>查看 <code class="notion-inline-code">diff</code>： 在 <code class="notion-inline-code">explorer</code> 里选择文件右键 <code class="notion-inline-code">Set file to compare</code>，然后需要对比的文件上右键选择 <code class="notion-inline-code">Compare with file_name_you_chose</code></li></ol><div class="notion-text notion-block-caab0ac36e224a2e96dc4b3d3f2e2bad"><b>快捷键：查找替换</b></div><ol start="1" class="notion-list notion-list-numbered notion-block-2eba93d7cace4202a6b6e60b15014d73"><li>查找 <code class="notion-inline-code">Ctrl+F</code></li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-723d1a9e810347e79afdf9e661c935ec"><li>查找替换 <code class="notion-inline-code">Ctrl+H</code></li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-ce9e40942aef460daab67a5711ce3513"><li>整个文件夹中查找 <code class="notion-inline-code">Ctrl+Shift+F</code></li></ol><div class="notion-text notion-block-33a8e1eee69f4af084d8ec7537242f82"><b>快捷键：显示相关</b></div><ol start="1" class="notion-list notion-list-numbered notion-block-3fd898532e684ba080efa4cd12a3ed63"><li>全屏：<code class="notion-inline-code">F11</code></li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-730d025ef32d4eb6aa7983683af293be"><li>zoomIn/zoomOut：<code class="notion-inline-code">Ctrl +/-</code></li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-63ee19d1ca37418a8a06835585d04f6c"><li>侧边栏显/隐：<code class="notion-inline-code">Ctrl+B</code></li></ol><ol start="4" class="notion-list notion-list-numbered notion-block-2543feaaa3ab41e59c861e575c7928cd"><li>显示资源管理器 <code class="notion-inline-code">Ctrl+Shift+E</code></li></ol><ol start="5" class="notion-list notion-list-numbered notion-block-8ed3ae14cd8f4ec5abda2ae4f72f9d58"><li>显示搜索 <code class="notion-inline-code">Ctrl+Shift+F</code></li></ol><ol start="6" class="notion-list notion-list-numbered notion-block-e0ac4a59747144c8804f463071bd1f59"><li>显示 Git <code class="notion-inline-code">Ctrl+Shift+G</code></li></ol><ol start="7" class="notion-list notion-list-numbered notion-block-8e00ebdf41e046bdb161f51e54cf8e53"><li>显示 Debug <code class="notion-inline-code">Ctrl+Shift+D</code></li></ol><ol start="8" class="notion-list notion-list-numbered notion-block-4958a2956dd349f98404cbe44171a4a7"><li>显示 Output <code class="notion-inline-code">Ctrl+Shift+U</code></li></ol><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-86bf0e92b61d440e834f2c542a0a1f61" data-id="86bf0e92b61d440e834f2c542a0a1f61"><span><div id="86bf0e92b61d440e834f2c542a0a1f61" class="notion-header-anchor"></div><a class="notion-hash-link" href="#86bf0e92b61d440e834f2c542a0a1f61" title="5.4【实战】2个小项目"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>5.4【实战】2个小项目</b></span></span></h4><div class="notion-text notion-block-91ef6d0d2ead45a08659e53efabeecc0">通过手写2个小项目，呈现出基本的C++工程建立的过程，并编译运行这两个小项目</div><ul class="notion-list notion-list-disc notion-block-3e4ac5ff31834652a59b64f17a6e2bd1"><li><b>项目1：Hello world</b></li></ul><ul class="notion-list notion-list-disc notion-block-a71d8e18d42c4dfa85863f2ccfebcdab"><li><b>项目2：Swap with class</b></li></ul><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-16b002eab2b44fd0a26a1ea6adb3d6c2" data-id="16b002eab2b44fd0a26a1ea6adb3d6c2"><span><div id="16b002eab2b44fd0a26a1ea6adb3d6c2" class="notion-header-anchor"></div><a class="notion-hash-link" href="#16b002eab2b44fd0a26a1ea6adb3d6c2" title="5.4.1 高频使用技巧"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>5.4.1 高频使用技巧</b></span></span></h4><ul class="notion-list notion-list-disc notion-block-fd97799312f8453b908f61604dce4b76"><li>左右分屏</li></ul><ul class="notion-list notion-list-disc notion-block-fed87d1e7f4046c398719cf9bb2ebdcf"><li>固定打开的文件</li></ul><ul class="notion-list notion-list-disc notion-block-322abd869529460ab783a0010461f8ea"><li>格式化代码</li></ul><ul class="notion-list notion-list-disc notion-block-694ef71e634f4309bf54fa653a9a6e1a"><li>Rename Symbol</li></ul><ul class="notion-list notion-list-disc notion-block-33c5b73d4916462eb21977eeeb7ead0f"><li>显示minimap</li></ul><ul class="notion-list notion-list-disc notion-block-5d5cffdb9e524d799b8d188c449d22da"><li>侧边栏查看OUTLINE</li></ul><ul class="notion-list notion-list-disc notion-block-eddfae5e5e2840a6b3010b05ddeb2d6c"><li>全屏</li></ul><ul class="notion-list notion-list-disc notion-block-3b358fc549444cec8129075ef2e9bc71"><li>关闭多个打开的文件</li></ul><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-aab12e1aef674f0792028b358cf7c6c9" data-id="aab12e1aef674f0792028b358cf7c6c9"><span><div id="aab12e1aef674f0792028b358cf7c6c9" class="notion-header-anchor"></div><a class="notion-hash-link" href="#aab12e1aef674f0792028b358cf7c6c9" title="5.4.2 代码编写"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>5.4.2 代码编写</b></span></span></h4><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-f28a51ace10349fcb98e008667db67b4" data-id="f28a51ace10349fcb98e008667db67b4"><span><div id="f28a51ace10349fcb98e008667db67b4" class="notion-header-anchor"></div><a class="notion-hash-link" href="#f28a51ace10349fcb98e008667db67b4" title="5.4.3 编译并运行"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>5.4.3 编译并运行</b></span></span></h4><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-2634cd79693c46f3b220e043c77fb2ff" data-id="2634cd79693c46f3b220e043c77fb2ff"><span><div id="2634cd79693c46f3b220e043c77fb2ff" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2634cd79693c46f3b220e043c77fb2ff" title="第六讲：CMake"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>第六讲：CMake</b></span></span></h3><div class="notion-text notion-block-a7e2daa9fe6641f6bba93f22144aa714"><b>前言</b>：</div><ul class="notion-list notion-list-disc notion-block-00390cb70f3f4a00a3859bc30b7ab238"><li><b>CMake</b>是一个<b>跨平台</b>的安装<b>编译工具</b>，可以用<b>简单</b>的语句来描述<b>所有平台</b>的安装(编译过程)。</li></ul><ul class="notion-list notion-list-disc notion-block-9aa4f31e39f54a8a937358bd1d85ac27"><li>CMake可以说已经成为<b>大部分C++开源项目标配</b></li></ul><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-fbe8c45db03e4ced8dee62e72f2e0637" data-id="fbe8c45db03e4ced8dee62e72f2e0637"><span><div id="fbe8c45db03e4ced8dee62e72f2e0637" class="notion-header-anchor"></div><a class="notion-hash-link" href="#fbe8c45db03e4ced8dee62e72f2e0637" title="6.1 Cross-platform development"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>6.1 Cross-platform development</b></span></span></h4><div class="notion-text notion-block-9fac83018dc2453c93a24dee806ec828">Let’s assume you have some cross-platform project with C++ code shared along different platforms/IDEs. Say you use <code class="notion-inline-code">Visual Studio</code> on Windows, <code class="notion-inline-code">Xcode</code> on OSX and <code class="notion-inline-code">Makefile</code> for Linux:</div><div class="notion-text notion-block-2f9c00a36b7d41f19d1dba6c3eb46f5e">What you will do if you want to add new <code class="notion-inline-code">bar.cpp</code> source file? You have to add it to every tool you use:</div><div class="notion-text notion-block-4e22b51acd4f41fd93cf95ce7ec71f24">To keep the environment consistent you have to do the similar update several times. And the most important thing is that you have to do it <b>manually</b> (arrow marked with a red color on the diagram in this case). Of course such approach is error prone and not flexible.</div><div class="notion-text notion-block-06d55c7c1b374e639b358e449da02b85">CMake solve this design flaw by adding extra step to development process. You can describe your project in <code class="notion-inline-code">CMakeLists.txt</code> file and use <a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://cgold.readthedocs.io/en/latest/glossary/CMake.html#id1">CMake</a> to generate tools you currently interested in using cross-platform <a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://cgold.readthedocs.io/en/latest/glossary/CMake.html#id1">CMake</a> code:</div><div class="notion-text notion-block-24363d72b38e4c1da15272d62886438f">Same action - adding new <code class="notion-inline-code">bar.cpp</code> file, will be done in <b>one step</b> now:</div><div class="notion-text notion-block-76bb925b32d2422295962a7ac1930076">Note that the bottom part of the diagram <b>was not changed</b>. I.e. you still can keep using your favorite tools like <code class="notion-inline-code">Visual Studio/msbuild</code>, <code class="notion-inline-code">Xcode/xcodebuild</code> and <code class="notion-inline-code">Makefile/make</code>!</div><hr class="notion-hr notion-block-2f478bb2b3214d7b9832796f451f0486"/><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-0f8f71b427804fe48fb9a03ca15d1008" data-id="0f8f71b427804fe48fb9a03ca15d1008"><span><div id="0f8f71b427804fe48fb9a03ca15d1008" class="notion-header-anchor"></div><a class="notion-hash-link" href="#0f8f71b427804fe48fb9a03ca15d1008" title="6.2 语法特性介绍"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>6.2 语法特性介绍</b></span></span></h4><ul class="notion-list notion-list-disc notion-block-b81c65e6fe5c451a8aacf0663974158c"><li><b>基本语法格式：指令(参数 1 参数 2...)</b></li><ul class="notion-list notion-list-disc notion-block-b81c65e6fe5c451a8aacf0663974158c"><li>参数使用<b>括弧</b>括起</li><li>参数之间使用<b>空格</b>或<b>分号</b>分开</li></ul></ul><ul class="notion-list notion-list-disc notion-block-00d1b70893374ea39287dee80236a72e"><li><b>指令是大小写无关的，参数和变量是大小写相关的</b></li><ul class="notion-list notion-list-disc notion-block-00d1b70893374ea39287dee80236a72e"></ul></ul><ul class="notion-list notion-list-disc notion-block-3dbf58676a28444eb152dda2698fa0f7"><li><b>变量使用${}方式取值，但是在 IF 控制语句中是直接使用变量名</b></li></ul><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-26b6a5a25650412a83b0e420eb17e4b6" data-id="26b6a5a25650412a83b0e420eb17e4b6"><span><div id="26b6a5a25650412a83b0e420eb17e4b6" class="notion-header-anchor"></div><a class="notion-hash-link" href="#26b6a5a25650412a83b0e420eb17e4b6" title="6.3 重要指令和CMake常用变量"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>6.3 重要指令和CMake常用变量</b></span></span></h4><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-9eafc51456f04c07b4b8cfae66d47500" data-id="9eafc51456f04c07b4b8cfae66d47500"><span><div id="9eafc51456f04c07b4b8cfae66d47500" class="notion-header-anchor"></div><a class="notion-hash-link" href="#9eafc51456f04c07b4b8cfae66d47500" title="6.3.1 重要指令"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>6.3.1 重要指令</b></span></span></h4><ul class="notion-list notion-list-disc notion-block-990b1d87488e41aaa424c20aff4d6148"><li><b>cmake_minimum_required</b> <b>指定CMake的最小版本要求</b></li><ul class="notion-list notion-list-disc notion-block-990b1d87488e41aaa424c20aff4d6148"><li>语法： <b>cmake_minimum_required(VERSION versionNumber [FATAL_ERROR])</b></li></ul></ul><ul class="notion-list notion-list-disc notion-block-54189ffe42f24d8687537bb4923a11f6"><li><b>project</b> <b>定义工程名称，并可指定工程支持的语言</b></li><ul class="notion-list notion-list-disc notion-block-54189ffe42f24d8687537bb4923a11f6"><li>语法： <b>project(projectname [CXX] [C] [Java])</b></li></ul></ul><ul class="notion-list notion-list-disc notion-block-58615c2375e64671a48254712bbae341"><li><b>set</b> <b>显式的定义变量</b></li><ul class="notion-list notion-list-disc notion-block-58615c2375e64671a48254712bbae341"><li>语法：<b>set(VAR [VALUE] [CACHE TYPE DOCSTRING [FORCE]])</b></li></ul></ul><ul class="notion-list notion-list-disc notion-block-0b757920156642e5978f173244cf6cd0"><li><b>include_directories 向工程添加多个特定的头文件搜索路径</b> ---&gt;相当于指定g++编译器的-I参数</li><ul class="notion-list notion-list-disc notion-block-0b757920156642e5978f173244cf6cd0"><li>语法： <b>include_directories([AFTER|BEFORE] [SYSTEM] dir1 dir2 ...)</b></li></ul></ul><ul class="notion-list notion-list-disc notion-block-fd01411d93324c42855e5384d405b284"><li><b>link_directories</b> <b>向工程添加多个特定的库文件搜索路径</b> ---&gt;相当于指定g++编译器的-L参数</li><ul class="notion-list notion-list-disc notion-block-fd01411d93324c42855e5384d405b284"><li>语法： <b>link_directories(dir1 dir2 ...) </b></li></ul></ul><ul class="notion-list notion-list-disc notion-block-78f378651309479eb43b4136a5b502ee"><li><b>add_library</b> <b>生成库文件</b></li><ul class="notion-list notion-list-disc notion-block-78f378651309479eb43b4136a5b502ee"><li>语法： <b>add_library(libname [SHARED|STATIC|MODULE] [EXCLUDE_FROM_ALL] source1 source2 ... sourceN)</b></li></ul></ul><ul class="notion-list notion-list-disc notion-block-e33e11b7d6fd4f74b1628942fe8ff1b6"><li><b>add_compile_options</b> 添加编译参数</li><ul class="notion-list notion-list-disc notion-block-e33e11b7d6fd4f74b1628942fe8ff1b6"><li>语法：<b>add_compile_options(&lt;option&gt; ...)</b></li></ul></ul><ul class="notion-list notion-list-disc notion-block-a2581082e3084f818ba63f70a836b00a"><li><b>add_executable</b> <b>生成可执行文件</b></li><ul class="notion-list notion-list-disc notion-block-a2581082e3084f818ba63f70a836b00a"><li>语法：<b>add_executable(exename source1 source2 ... sourceN)</b></li></ul></ul><ul class="notion-list notion-list-disc notion-block-079b5df474e54673992fe93803113f27"><li><b>target_link_libraries</b> <b>为 target 添加需要链接的共享库 </b>--&gt;相同于指定g++编译器-l参数</li><ul class="notion-list notion-list-disc notion-block-079b5df474e54673992fe93803113f27"><li>语法： <b>target_link_libraries(target library1&lt;debug | optimized&gt; library2...)</b></li></ul></ul><ul class="notion-list notion-list-disc notion-block-aa79c8174adb42e6a4d1655f2445ed93"><li><b>add_subdirectory 向当前工程添加存放源文件的子目录，并可以指定中间二进制和目标二进制存放的位置</b></li><ul class="notion-list notion-list-disc notion-block-aa79c8174adb42e6a4d1655f2445ed93"><li>语法： <b>add_subdirectory(source_dir [binary_dir] [EXCLUDE_FROM_ALL])</b></li></ul></ul><ul class="notion-list notion-list-disc notion-block-22419883fcb144fca592c74b5ebb1410"><li><b>aux_source_directory 发现一个目录下所有的源代码文件并将列表存储在一个变量中，这个指令临时被用来自动构建源文件列表</b></li><ul class="notion-list notion-list-disc notion-block-22419883fcb144fca592c74b5ebb1410"><li>语法： <b>aux_source_directory(dir VARIABLE)</b></li></ul></ul><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-c218a746bbee47d5a44a876008a0d003" data-id="c218a746bbee47d5a44a876008a0d003"><span><div id="c218a746bbee47d5a44a876008a0d003" class="notion-header-anchor"></div><a class="notion-hash-link" href="#c218a746bbee47d5a44a876008a0d003" title="6.3.2 CMake常用变量"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>6.3.2 CMake常用变量</b></span></span></h4><ul class="notion-list notion-list-disc notion-block-8a6dfd5a799640d288f5477519115198"><li><b>CMAKE_C_FLAGS gcc编译选项</b></li></ul><ul class="notion-list notion-list-disc notion-block-96ad36e9a5f347db9beec0e990302f65"><li><b>CMAKE_CXX_FLAGS g++编译选项</b></li><ul class="notion-list notion-list-disc notion-block-96ad36e9a5f347db9beec0e990302f65"></ul></ul><ul class="notion-list notion-list-disc notion-block-5531b81f55bd40b28993ee88c447a8d5"><li><b>CMAKE_BUILD_TYPE 编译类型(Debug, Release)</b></li><ul class="notion-list notion-list-disc notion-block-5531b81f55bd40b28993ee88c447a8d5"></ul></ul><ul class="notion-list notion-list-disc notion-block-39bb2ae335bc4bdeb6e0955815b99c09"><li><b>CMAKE_BINARY_DIR</b></li><ul class="notion-list notion-list-disc notion-block-39bb2ae335bc4bdeb6e0955815b99c09"><div class="notion-text notion-block-17a78e93babf44d383b1bc54cff4c051"><b>PROJECT_BINARY_DIR</b></div><div class="notion-text notion-block-83d7c417f9364c5d801e7b0f5b895bcb"><b>&lt;projectname&gt;_BINARY_DIR</b></div><blockquote class="notion-quote notion-block-d60b54c432a940678c59b6d09360c87b"><div>这三个变量指代的内容是一致的。如果是 in source build，指的就是工程顶层目录。如果是 out-of-source 编译,指的是工程编译发生的目录。PROJECT_BINARY_DIR 跟其他指令稍有区别，不过现在，你可以理解为他们是一致的。</div></blockquote></ul></ul><ul class="notion-list notion-list-disc notion-block-005246003a7f4b13820ab00d042a3c34"><li><b>CMAKE_SOURCE_DIR</b></li><ul class="notion-list notion-list-disc notion-block-005246003a7f4b13820ab00d042a3c34"><div class="notion-text notion-block-343a926c1c4941b0a5e1e6a2c1fc0214"><b>PROJECT_SOURCE_DIR&lt;projectname&gt;_SOURCE_DIR</b></div><blockquote class="notion-quote notion-block-8adec897ee3d43d3ab1d6822ad4347f4"><div>这三个变量指代的内容是一致的,不论采用何种编译方式,都是工程顶层目录。也就是在 in source build时,他跟 CMAKE_BINARY_DIR 等变量一致。PROJECT_SOURCE_DIR 跟其他指令稍有区别,现在,你可以理解为他们是一致的。</div></blockquote></ul></ul><hr class="notion-hr notion-block-fb6933fde8904706b8523559877cbe00"/><ul class="notion-list notion-list-disc notion-block-4039dcf00c3c4abd968bc44ec3d42c50"><li><b>CMAKE_C_COMPILER：指定C编译器</b></li></ul><ul class="notion-list notion-list-disc notion-block-15e2e01b977d4f96a31c5310c0885195"><li><b>CMAKE_CXX_COMPILER：指定C++编译器</b></li></ul><ul class="notion-list notion-list-disc notion-block-b87baff55d354f7f9ea62577d4cbfc12"><li><b>EXECUTABLE_OUTPUT_PATH：可执行文件输出的存放路径</b></li></ul><ul class="notion-list notion-list-disc notion-block-5dac4e3a4d024fc08115c14d93969888"><li><b>LIBRARY_OUTPUT_PATH：库文件输出的存放路径</b></li></ul><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-6e437ce19b444c818b6455c63eedac0d" data-id="6e437ce19b444c818b6455c63eedac0d"><span><div id="6e437ce19b444c818b6455c63eedac0d" class="notion-header-anchor"></div><a class="notion-hash-link" href="#6e437ce19b444c818b6455c63eedac0d" title="6.4 CMake编译工程"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>6.4 CMake编译工程</b></span></span></h4><div class="notion-text notion-block-9e9c75d865dc404ca84af9cdc3e376d2">CMake目录结构：项目主目录存在一个CMakeLists.txt文件</div><div class="notion-text notion-block-bec76575bd3f4b85bbbc90c07edaceeb"><b>两种方式设置编译规则</b>：</div><ol start="1" class="notion-list notion-list-numbered notion-block-c96bfebad58a4ef7b16cbe953ee78c9b"><li>包含源文件的子文件夹<b>包含</b>CMakeLists.txt文件，主目录的CMakeLists.txt通过add_subdirectory添加子目录即可；</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-5e1a8b2ba94a4415bc5d4719d706fc0e"><li>包含源文件的子文件夹<b>未包含</b>CMakeLists.txt文件，子目录编译规则体现在主目录的CMakeLists.txt中；</li></ol><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-a10e2451d6564fb39660c8c692c741a8" data-id="a10e2451d6564fb39660c8c692c741a8"><span><div id="a10e2451d6564fb39660c8c692c741a8" class="notion-header-anchor"></div><a class="notion-hash-link" href="#a10e2451d6564fb39660c8c692c741a8" title="6.4.1 编译流程"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>6.4.1 编译流程</b></span></span></h4><div class="notion-text notion-block-bfe8eadc424544438d459f353ee1f404"><b>在 linux 平台下使用 CMake 构建C/C++工程的流程如下:</b></div><ul class="notion-list notion-list-disc notion-block-0fd0489656464d1fb28b47824cfd8a16"><li>手动编写 CMakeLists.txt。</li></ul><ul class="notion-list notion-list-disc notion-block-f8dcb9ebf3b94c2b82fb091a56b63ef1"><li>执行命令 <code class="notion-inline-code">cmake PATH</code>生成 Makefile ( PATH 是顶层CMakeLists.txt 所在的目录 )。</li></ul><ul class="notion-list notion-list-disc notion-block-2e917861a32d423b8ae0fc3045266139"><li>执行命令<code class="notion-inline-code">make</code> 进行编译。</li></ul><hr class="notion-hr notion-block-9a4eab23c6454f36b868577d0a976ac2"/><hr class="notion-hr notion-block-e73d3b49b08841f8a74706ab58de01dc"/><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-8c3c7fffd93740eb8569e31d0e5831d0" data-id="8c3c7fffd93740eb8569e31d0e5831d0"><span><div id="8c3c7fffd93740eb8569e31d0e5831d0" class="notion-header-anchor"></div><a class="notion-hash-link" href="#8c3c7fffd93740eb8569e31d0e5831d0" title="6.4.2 两种构建方式"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>6.4.2 两种构建方式</b></span></span></h4><ul class="notion-list notion-list-disc notion-block-a7c8b81fdddc49eeb8b724df38fa2b03"><li><b>内部构建(in-source build)</b>：不推荐使用</li><ul class="notion-list notion-list-disc notion-block-a7c8b81fdddc49eeb8b724df38fa2b03"><div class="notion-text notion-block-27af4b2f54094a0e977baf76e5482279">内部构建会在同级目录下产生一大堆中间文件，这些中间文件并不是我们最终所需要的，和工程源文件放在一起会显得杂乱无章。</div></ul></ul><ul class="notion-list notion-list-disc notion-block-f40bf24eda7b4e5682b13974046120ab"><li><b>外部构建(out-of-source build)</b>：推荐使用</li><ul class="notion-list notion-list-disc notion-block-f40bf24eda7b4e5682b13974046120ab"><div class="notion-text notion-block-369857a382da4150aaf5f50e03b20754">将编译输出文件与源文件放到不同目录中</div></ul></ul><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-596091cfae8d4238a96c9933495fb6f2" data-id="596091cfae8d4238a96c9933495fb6f2"><span><div id="596091cfae8d4238a96c9933495fb6f2" class="notion-header-anchor"></div><a class="notion-hash-link" href="#596091cfae8d4238a96c9933495fb6f2" title="6.5 【实战】CMake代码实践"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>6.5 【实战】CMake代码实践</b></span></span></h4><div class="notion-text notion-block-fd80537eb30741d5aa091b8382180559">针对第五章写的两个小项目来写对应的CMakeLists.txt</div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-c595a3c814aa4e55aee0fb04afcfd114" data-id="c595a3c814aa4e55aee0fb04afcfd114"><span><div id="c595a3c814aa4e55aee0fb04afcfd114" class="notion-header-anchor"></div><a class="notion-hash-link" href="#c595a3c814aa4e55aee0fb04afcfd114" title="6.5.1 最小CMake工程"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>6.5.1 最小CMake工程</b></span></span></h4><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-84b5f00ada814b12ae4a1cb56daa1f05" data-id="84b5f00ada814b12ae4a1cb56daa1f05"><span><div id="84b5f00ada814b12ae4a1cb56daa1f05" class="notion-header-anchor"></div><a class="notion-hash-link" href="#84b5f00ada814b12ae4a1cb56daa1f05" title="6.5.2 多目录工程 - 直接编译"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>6.5.2 多目录工程 - 直接编译</b></span></span></h4><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-c6ef94f23eb044858adb3a67175f9578" data-id="c6ef94f23eb044858adb3a67175f9578"><span><div id="c6ef94f23eb044858adb3a67175f9578" class="notion-header-anchor"></div><a class="notion-hash-link" href="#c6ef94f23eb044858adb3a67175f9578" title="6.5.3 多目录工程 - 生成库编译"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>6.5.3 多目录工程 - 生成库编译</b></span></span></h4><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-c2c6fc249c824341b365b9ffd5ea8f2f" data-id="c2c6fc249c824341b365b9ffd5ea8f2f"><span><div id="c2c6fc249c824341b365b9ffd5ea8f2f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#c2c6fc249c824341b365b9ffd5ea8f2f" title="第七讲：【实战】使用VSCode进行完整项目开发"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>第七讲：【实战】使用VSCode进行完整项目开发</b></span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-1b1ad26423ff4c4188642caf94b82c1a" data-id="1b1ad26423ff4c4188642caf94b82c1a"><span><div id="1b1ad26423ff4c4188642caf94b82c1a" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1b1ad26423ff4c4188642caf94b82c1a" title="案例名称：士兵突击"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>案例名称：士兵突击</b></span></span></h4><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-216444362c7f43299cfa0fa3341d219c" data-id="216444362c7f43299cfa0fa3341d219c"><span><div id="216444362c7f43299cfa0fa3341d219c" class="notion-header-anchor"></div><a class="notion-hash-link" href="#216444362c7f43299cfa0fa3341d219c" title="需求列表："><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>需求列表：</b></span></span></h4><ol start="1" class="notion-list notion-list-numbered notion-block-d9313d9890d240d69bba050cdabd76ba"><li><b>士兵</b> <b>许三多</b> 有一把<b>枪</b>，叫做 <b>AK47</b></li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-97583f3491b0472e937629a3404da6a5"><li><b>士兵</b> 可以 <b>开火</b></li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-c3a9ee9297134edba1a5a180562e43c2"><li><b>士兵</b> 可以 <b>给枪装填子弹</b></li></ol><ol start="4" class="notion-list notion-list-numbered notion-block-f576f5cc44b646c19d51760cc0533716"><li><b>枪</b> 能够 <b>发射</b> 子弹</li></ol><ol start="5" class="notion-list notion-list-numbered notion-block-6b278dea73c14855b004b2969ef07143"><li><b>枪</b> 能够 <b>装填子弹</b> —— <b>增加子弹数量</b></li></ol><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-9887b1af3fc84a45a54fc563a31aa5fb" data-id="9887b1af3fc84a45a54fc563a31aa5fb"><span><div id="9887b1af3fc84a45a54fc563a31aa5fb" class="notion-header-anchor"></div><a class="notion-hash-link" href="#9887b1af3fc84a45a54fc563a31aa5fb" title="开发过程："><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>开发过程：</b></span></span></h4><ul class="notion-list notion-list-disc notion-block-b8b70ce10ab94170b3cf9e23419bc461"><li>开发枪类</li></ul><ul class="notion-list notion-list-disc notion-block-d86aca12dd354d9f98691eb226a7090a"><li>开发士兵类</li></ul><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-02cebdcdf1f84a99960dc6857c28b0af" data-id="02cebdcdf1f84a99960dc6857c28b0af"><span><div id="02cebdcdf1f84a99960dc6857c28b0af" class="notion-header-anchor"></div><a class="notion-hash-link" href="#02cebdcdf1f84a99960dc6857c28b0af" title="7.1 合理设置项目目录"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>7.1 合理设置项目目录</b></span></span></h4><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-c03bded4ec304978b844c65dbf303636" data-id="c03bded4ec304978b844c65dbf303636"><span><div id="c03bded4ec304978b844c65dbf303636" class="notion-header-anchor"></div><a class="notion-hash-link" href="#c03bded4ec304978b844c65dbf303636" title="7.2 编写项目源文件"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>7.2 编写项目源文件</b></span></span></h4><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-2e36256ac8b44612b6ba3f315d787e4e" data-id="2e36256ac8b44612b6ba3f315d787e4e"><span><div id="2e36256ac8b44612b6ba3f315d787e4e" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2e36256ac8b44612b6ba3f315d787e4e" title="7.3 编写CMakeLists.txt构建项目编译规则"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>7.3 编写CMakeLists.txt构建项目编译规则</b></span></span></h4><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-697c161212884c3a91a2fd97bb76916c" data-id="697c161212884c3a91a2fd97bb76916c"><span><div id="697c161212884c3a91a2fd97bb76916c" class="notion-header-anchor"></div><a class="notion-hash-link" href="#697c161212884c3a91a2fd97bb76916c" title="7.4 使用外部构建，手动编译CMake项目"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>7.4 使用外部构建，手动编译CMake项目</b></span></span></h4><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-a746bc658fd64830a4529d59802e4b8b" data-id="a746bc658fd64830a4529d59802e4b8b"><span><div id="a746bc658fd64830a4529d59802e4b8b" class="notion-header-anchor"></div><a class="notion-hash-link" href="#a746bc658fd64830a4529d59802e4b8b" title="7.5 配置VSCode的json文件并调试项目"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>7.5 配置VSCode的json文件并调试项目</b></span></span></h4></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[基于VSCode和CMake实现的C/C++开发-Windows篇]]></title>
            <link>https://tangly1024.com/article/vscode-windows</link>
            <guid>https://tangly1024.com/article/vscode-windows</guid>
            <pubDate>Mon, 14 Aug 2023 00:00:00 GMT</pubDate>
            <description><![CDATA[B站VSCode-Windows课程课件]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-293479f098fb40bca5e74b6a4e0c35a2"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-a86d190ae50c4eae9c1471ee2361af5d" data-id="a86d190ae50c4eae9c1471ee2361af5d"><span><div id="a86d190ae50c4eae9c1471ee2361af5d" class="notion-header-anchor"></div><a class="notion-hash-link" href="#a86d190ae50c4eae9c1471ee2361af5d" title="1. 开发环境搭建："><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>1. 开发环境搭建：</b></span></span></h2><ul class="notion-list notion-list-disc notion-block-d664a0c2c18e4b5f8cde46eb4dc118b6"><li>安装<b>mingw-w64编译器</b>（GCC for Windows 64 &amp; 32 bits）、<b>Cmake工具(选装)</b></li><ul class="notion-list notion-list-disc notion-block-d664a0c2c18e4b5f8cde46eb4dc118b6"><li>可自行去官网下载，网速较慢，让人崩溃</li><li>公众号“<b>VSCode</b>”回复“<b>cpp</b>&quot;可下载以上安装包</li><li>设置<b>环境变量</b>，并检查是否安装成功</li></ul></ul><ul class="notion-list notion-list-disc notion-block-780c2e9920894c6d926faf6b93631725"><li><b>VSCode插件安装</b></li><ul class="notion-list notion-list-disc notion-block-780c2e9920894c6d926faf6b93631725"><li><b>C/C++</b></li><li><b>cmake（选装）</b></li><li><b>cmake tools（选装）</b></li></ul></ul><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-ae5879882cd346b082c080961dcc936c" data-id="ae5879882cd346b082c080961dcc936c"><span><div id="ae5879882cd346b082c080961dcc936c" class="notion-header-anchor"></div><a class="notion-hash-link" href="#ae5879882cd346b082c080961dcc936c" title="2. 代码实践演练："><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>2. 代码实践演练：</b></span></span></h2><ul class="notion-list notion-list-disc notion-block-21674bda9ac24513bb4b36e414d8a915"><li><b>基于g++命令</b></li><ul class="notion-list notion-list-disc notion-block-21674bda9ac24513bb4b36e414d8a915"><li>g++编译<b>单</b>文件，生成<b>带调试信息的可执行文件</b>、并<b>调试</b></li><li>g++编译<b>多</b>文件，生成<b>带调试信息的可执行文件</b>、并<b>调试</b></li></ul></ul><ul class="notion-list notion-list-disc notion-block-43e6b00dc63c4a7ebd0832e3fee817fa"><li><b>基于cmake</b></li><ul class="notion-list notion-list-disc notion-block-43e6b00dc63c4a7ebd0832e3fee817fa"><li>编写最简单的<b>CMakeLists.txt</b></li><li>进行<b>多文件编译</b>，并<b>调试</b></li></ul></ul><ul class="notion-list notion-list-disc notion-block-a0f5601b4e434d488b32e9ef0e782e3d"><li><b>配置json</b></li><ul class="notion-list notion-list-disc notion-block-a0f5601b4e434d488b32e9ef0e782e3d"><li><em><b>launch.json</b></em> -- for debug</li><div class="notion-text notion-block-7777c7ca398f483d95a3f4291f9f3239"><b>作用：配置调试信息，用来调试编译好的文件：</b></div><ol start="1" class="notion-list notion-list-numbered notion-block-26c369bd5b0d4507961ccfe6455ef4b7"><li><b>program</b>：可执行文件的路径；</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-e114245084fa40e3856191b08938af36"><li><b>preLaunchTask</b>：执行调试前所执行的task</li></ol><li><em><b>tasks.json</b></em> -- for build before debug</li><div class="notion-text notion-block-9905e9bc6f3e4e989f3f1d8238fde5eb"><b>作用：包含调试前的操作指令，用来做调试前的编译工作</b></div><ol start="1" class="notion-list notion-list-numbered notion-block-540588d02d12466b952f34bb03fd20cf"><li>可以避免每次修改代码后，手动编译；即tasks.json其实是和手动编译的作用等价的。</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-92ecf91d1833418695a06721571c38c0"><li>tasks.json包含了某个task的编译命令: 编译代码，并生成可执行文件。</li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-c17e2da7b4d74480bb2cebfc2e10c204"><li>label 应与launch.json中的preLaunchTask名字一致</li></ol><hr class="notion-hr notion-block-3690d6579d114cdeb1bae38f0dbb228f"/><div class="notion-text notion-block-3654073ce6b94cf39af5dd8c36b08d59">视频教程中给出的CMake工程的tasks.json</div></ul></ul></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[模板说明]]></title>
            <link>https://tangly1024.com/article/guide</link>
            <guid>https://tangly1024.com/article/guide</guid>
            <pubDate>Fri, 02 Jul 2021 00:00:00 GMT</pubDate>
            <description><![CDATA[这是nextnotion自带模板说明]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-1b35bf3b734b4a139d501d571b573715"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-table-of-contents notion-gray notion-block-76f2cfea03d042f8baec40008f27316f"><a href="#fee0242c79e545b4a8a95ebb544e36a1" class="notion-table-of-contents-item"><span class="notion-table-of-contents-item-body" style="display:inline-block;margin-left:0">模板使用说明</span></a><a href="#bb4bf52e59d14fc4a9e2d952abc64061" class="notion-table-of-contents-item"><span class="notion-table-of-contents-item-body" style="display:inline-block;margin-left:0">更多说明帮助</span></a></div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-fee0242c79e545b4a8a95ebb544e36a1" data-id="fee0242c79e545b4a8a95ebb544e36a1"><span><div id="fee0242c79e545b4a8a95ebb544e36a1" class="notion-header-anchor"></div><a class="notion-hash-link" href="#fee0242c79e545b4a8a95ebb544e36a1" title="模板使用说明"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">模板使用说明</span></span></h2><div class="notion-text notion-block-9f469fb005db4483814863f4c340419a">您的NotionNext项目必须绑定一个Notion数据库才能使用。</div><div class="notion-text notion-block-d4144ffa0bcc4d5cb87602f4866819e5">请复制该模板到您的Notion中，并按照模板格式创建文章：</div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-714eb25bbdb14af9bd58e90e489ace45" href="https://tanghh.notion.site/02ab3b8678004aa69e9e415905ef32a5?v=b7eb215720224ca5827bfaa5ef82cf2d"><div><div class="notion-bookmark-title">NOTION BLOG</div><div class="notion-bookmark-description">演示站点描述</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-text">https://tanghh.notion.site/02ab3b8678004aa69e9e415905ef32a5?v=b7eb215720224ca5827bfaa5ef82cf2d</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://tanghh.notion.site/image/https%3A%2F%2Fp1.qhimg.com%2Fbdm%2F1600_900_100%2Ft01e66d486b8e826270.jpg?table=collection&amp;id=4379bc14-5d22-453b-a153-12639616fc01&amp;spaceId=6c096b44-beb9-48ee-8f92-1efdde47f3a3&amp;width=2000&amp;userId=&amp;cache=v2" alt="NOTION BLOG" loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-c15c2f108b0441f382d3ab6215728977"> </div><div class="notion-sync-block notion-block-380d005ba59e4df99a45108a314a7b5b"><h3 class="notion-h notion-h2 notion-block-e3036260473c48978b6aa0bde61e49bb" data-id="e3036260473c48978b6aa0bde61e49bb"><span><div id="e3036260473c48978b6aa0bde61e49bb" class="notion-header-anchor"></div><a class="notion-hash-link" href="#e3036260473c48978b6aa0bde61e49bb" title="Notion模板字段说明"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">Notion模板字段说明</span></span></h3><div class="notion-text notion-block-b057020681814abd946a1f90454a8454">Notion数据库中，每条数据都将有以下属性🤔：</div><table class="notion-simple-table notion-block-55c1c92e75234f168f0626bcf819a9c3"><tbody><tr class="notion-simple-table-row notion-block-073acd024cba4b1d8524d8f388be87cb"><td class="" style="width:116.99479675292969px"><div class="notion-simple-table-cell">属性</div></td><td class="" style="width:46.989585876464844px"><div class="notion-simple-table-cell">必填</div></td><td class="" style="width:239.00001525878906px"><div class="notion-simple-table-cell">说明</div></td><td class="" style="width:315.66668701171875px"><div class="notion-simple-table-cell">备注</div></td></tr><tr class="notion-simple-table-row notion-block-b3b4244f9e3b4d3d815f1a6ed80449be"><td class="" style="width:116.99479675292969px"><div class="notion-simple-table-cell"><code class="notion-inline-code">title</code></div></td><td class="" style="width:46.989585876464844px"><div class="notion-simple-table-cell"> 是</div></td><td class="" style="width:239.00001525878906px"><div class="notion-simple-table-cell"> 文章标题</div></td><td class="" style="width:315.66668701171875px"><div class="notion-simple-table-cell">ㅤ</div></td></tr><tr class="notion-simple-table-row notion-block-77d64baa32a745059177cd7a09d33513"><td class="" style="width:116.99479675292969px"><div class="notion-simple-table-cell"><code class="notion-inline-code">status</code></div></td><td class="" style="width:46.989585876464844px"><div class="notion-simple-table-cell">是</div></td><td class="" style="width:239.00001525878906px"><div class="notion-simple-table-cell">发布状态</div></td><td class="" style="width:315.66668701171875px"><div class="notion-simple-table-cell">（仅当状态为<code class="notion-inline-code">Published</code> 时会被 展示）</div></td></tr><tr class="notion-simple-table-row notion-block-042a02920aa1466a85ee68aed16d8fbf"><td class="" style="width:116.99479675292969px"><div class="notion-simple-table-cell"><code class="notion-inline-code">type</code></div></td><td class="" style="width:46.989585876464844px"><div class="notion-simple-table-cell">是</div></td><td class="" style="width:239.00001525878906px"><div class="notion-simple-table-cell">页面类型 (博文<code class="notion-inline-code">Post</code> / 单页(<code class="notion-inline-code">Page</code>)</div></td><td class="" style="width:315.66668701171875px"><div class="notion-simple-table-cell">单页不会在博文列表显示 。</div></td></tr><tr class="notion-simple-table-row notion-block-6560b4a3b3ad4ceea37e88ffd0dbecc0"><td class="" style="width:116.99479675292969px"><div class="notion-simple-table-cell"><code class="notion-inline-code">summary</code></div></td><td class="" style="width:46.989585876464844px"><div class="notion-simple-table-cell">否</div></td><td class="" style="width:239.00001525878906px"><div class="notion-simple-table-cell">内容摘要</div></td><td class="" style="width:315.66668701171875px"><div class="notion-simple-table-cell">搜索和简略显示会用到</div></td></tr><tr class="notion-simple-table-row notion-block-dde38cbfcf4c4673a1b671859ee30319"><td class="" style="width:116.99479675292969px"><div class="notion-simple-table-cell"><code class="notion-inline-code">date</code></div></td><td class="" style="width:46.989585876464844px"><div class="notion-simple-table-cell">否</div></td><td class="" style="width:239.00001525878906px"><div class="notion-simple-table-cell">发布日期</div></td><td class="" style="width:315.66668701171875px"><div class="notion-simple-table-cell">在V3.3.9之前的版本此项为必填。</div></td></tr><tr class="notion-simple-table-row notion-block-3b095aaec42c4ccdbf19d10551d323eb"><td class="" style="width:116.99479675292969px"><div class="notion-simple-table-cell"><code class="notion-inline-code">category</code></div></td><td class="" style="width:46.989585876464844px"><div class="notion-simple-table-cell">否</div></td><td class="" style="width:239.00001525878906px"><div class="notion-simple-table-cell">文章分类</div></td><td class="" style="width:315.66668701171875px"><div class="notion-simple-table-cell">可以自定义</div></td></tr><tr class="notion-simple-table-row notion-block-cfb0fe2eb92443209c850051240bf6cd"><td class="" style="width:116.99479675292969px"><div class="notion-simple-table-cell"><code class="notion-inline-code">tags</code></div></td><td class="" style="width:46.989585876464844px"><div class="notion-simple-table-cell">否</div></td><td class="" style="width:239.00001525878906px"><div class="notion-simple-table-cell">文章标签</div></td><td class="" style="width:315.66668701171875px"><div class="notion-simple-table-cell">可多个，建议不要太多</div></td></tr><tr class="notion-simple-table-row notion-block-56c44083010e42ab8f1a872627738bda"><td class="" style="width:116.99479675292969px"><div class="notion-simple-table-cell"><code class="notion-inline-code">slug</code></div></td><td class="" style="width:46.989585876464844px"><div class="notion-simple-table-cell">否</div></td><td class="" style="width:239.00001525878906px"><div class="notion-simple-table-cell">文章短路径</div></td><td class="" style="width:315.66668701171875px"><div class="notion-simple-table-cell"> (每篇文章唯一，请勿 重复）</div></td></tr><tr class="notion-simple-table-row notion-block-16889cb6f5b14d3f913235459b3bffca"><td class="" style="width:116.99479675292969px"><div class="notion-simple-table-cell"><code class="notion-inline-code">icon</code></div></td><td class="" style="width:46.989585876464844px"><div class="notion-simple-table-cell">否</div></td><td class="" style="width:239.00001525878906px"><div class="notion-simple-table-cell">菜单栏图标(仅当<code class="notion-inline-code">Page</code>/<code class="notion-inline-code">Menu</code>类型有效)</div></td><td class="" style="width:315.66668701171875px"><div class="notion-simple-table-cell">可以参考：<a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://fontawesome.com/v6/search">图标库地址</a></div></td></tr><tr class="notion-simple-table-row notion-block-dff103561dc944e9a6448b2e0b37921a"><td class="" style="width:116.99479675292969px"><div class="notion-simple-table-cell"><code class="notion-inline-code">password</code></div></td><td class="" style="width:46.989585876464844px"><div class="notion-simple-table-cell"> 否</div></td><td class="" style="width:239.00001525878906px"><div class="notion-simple-table-cell"> 文章加锁</div></td><td class="" style="width:315.66668701171875px"><div class="notion-simple-table-cell"> 需要输入密码才允许访问</div></td></tr></tbody></table><div class="notion-blank notion-block-aef6dc1116fa4e969d702901edf40e2e"> </div></div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-bb4bf52e59d14fc4a9e2d952abc64061" data-id="bb4bf52e59d14fc4a9e2d952abc64061"><span><div id="bb4bf52e59d14fc4a9e2d952abc64061" class="notion-header-anchor"></div><a class="notion-hash-link" href="#bb4bf52e59d14fc4a9e2d952abc64061" title="更多说明帮助"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">更多说明帮助</span></span></h2><div class="notion-text notion-block-7044276d52ff4a7895d84eeaa7ec7746">请访问教程</div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-9eff50f74faa44fcae4973a0dc7dc96e" href="https://tangly1024.com/article/notion-next-guide"><div><div class="notion-bookmark-title">NotionNext 操作手册 | TANGLY’s BLOG</div><div class="notion-bookmark-description">介绍NotionNext的所有功能和常见问题说明</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://tangly1024.com/favicon.ico" alt="NotionNext 操作手册 | TANGLY’s BLOG" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://tangly1024.com/article/notion-next-guide</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://images.unsplash.com/photo-1587620931276-d97f425f62b9?ixlib=rb-4.0.3&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb" alt="NotionNext 操作手册 | TANGLY’s BLOG" loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-b35436d8ce264ec2a3be8dc7f387d42a"> </div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[模板说明]]></title>
            <link>https://tangly1024.com/article/guide</link>
            <guid>https://tangly1024.com/article/guide</guid>
            <pubDate>Fri, 02 Jul 2021 00:00:00 GMT</pubDate>
            <description><![CDATA[这是nextnotion自带模板说明]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-2291092777634ee88a29bd24516414e4"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-table-of-contents notion-gray notion-block-5339b3a5a09b4cbd83f2c55888f4265b"><a href="#d4056e2bcaf64aa688bf0bafce37138e" class="notion-table-of-contents-item"><span class="notion-table-of-contents-item-body" style="display:inline-block;margin-left:0">模板使用说明</span></a><a href="#330778472f6a4e8f9071c30a8a109f93" class="notion-table-of-contents-item"><span class="notion-table-of-contents-item-body" style="display:inline-block;margin-left:0">更多说明帮助</span></a></div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-d4056e2bcaf64aa688bf0bafce37138e" data-id="d4056e2bcaf64aa688bf0bafce37138e"><span><div id="d4056e2bcaf64aa688bf0bafce37138e" class="notion-header-anchor"></div><a class="notion-hash-link" href="#d4056e2bcaf64aa688bf0bafce37138e" title="模板使用说明"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">模板使用说明</span></span></h2><div class="notion-text notion-block-c3566227fe3c491089e7123919e80721">您的NotionNext项目必须绑定一个Notion数据库才能使用。</div><div class="notion-text notion-block-f2ddbbb9520e4d33971a05492f8be8cd">请复制该模板到您的Notion中，并按照模板格式创建文章：</div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-e07f8cd813ca41a9a287fedfd94d33f0" href="https://tanghh.notion.site/02ab3b8678004aa69e9e415905ef32a5?v=b7eb215720224ca5827bfaa5ef82cf2d"><div><div class="notion-bookmark-title">NOTION BLOG</div><div class="notion-bookmark-description">演示站点描述</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-text">https://tanghh.notion.site/02ab3b8678004aa69e9e415905ef32a5?v=b7eb215720224ca5827bfaa5ef82cf2d</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://tanghh.notion.site/image/https%3A%2F%2Fp1.qhimg.com%2Fbdm%2F1600_900_100%2Ft01e66d486b8e826270.jpg?table=collection&amp;id=4379bc14-5d22-453b-a153-12639616fc01&amp;spaceId=6c096b44-beb9-48ee-8f92-1efdde47f3a3&amp;width=2000&amp;userId=&amp;cache=v2" alt="NOTION BLOG" loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-bc56017bef9a4480a770728ef8b7b35b"> </div><div class="notion-sync-block notion-block-fa25d07a1d3e448c8986fd0da7845d4b"><h3 class="notion-h notion-h2 notion-block-f5f8025446da46868956fa254d81fba6" data-id="f5f8025446da46868956fa254d81fba6"><span><div id="f5f8025446da46868956fa254d81fba6" class="notion-header-anchor"></div><a class="notion-hash-link" href="#f5f8025446da46868956fa254d81fba6" title="Notion模板字段说明"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">Notion模板字段说明</span></span></h3><div class="notion-text notion-block-e70d3e13af3b4fb499d3255f40cf8299">Notion数据库中，每条数据都将有以下属性🤔：</div><table class="notion-simple-table notion-block-174dfc0b41664c9ab330813f77e67108"><tbody><tr class="notion-simple-table-row notion-block-5155f412aedd4470a053d60f809c3bf1"><td class="" style="width:116.99479675292969px"><div class="notion-simple-table-cell">属性</div></td><td class="" style="width:46.989585876464844px"><div class="notion-simple-table-cell">必填</div></td><td class="" style="width:239.00001525878906px"><div class="notion-simple-table-cell">说明</div></td><td class="" style="width:315.66668701171875px"><div class="notion-simple-table-cell">备注</div></td></tr><tr class="notion-simple-table-row notion-block-032013e25c7945acabba2b64bc448d8e"><td class="" style="width:116.99479675292969px"><div class="notion-simple-table-cell"><code class="notion-inline-code">title</code></div></td><td class="" style="width:46.989585876464844px"><div class="notion-simple-table-cell"> 是</div></td><td class="" style="width:239.00001525878906px"><div class="notion-simple-table-cell"> 文章标题</div></td><td class="" style="width:315.66668701171875px"><div class="notion-simple-table-cell">ㅤ</div></td></tr><tr class="notion-simple-table-row notion-block-dc23e6d9d7dd4801bb9ccc500db7831b"><td class="" style="width:116.99479675292969px"><div class="notion-simple-table-cell"><code class="notion-inline-code">status</code></div></td><td class="" style="width:46.989585876464844px"><div class="notion-simple-table-cell">是</div></td><td class="" style="width:239.00001525878906px"><div class="notion-simple-table-cell">发布状态</div></td><td class="" style="width:315.66668701171875px"><div class="notion-simple-table-cell">（仅当状态为<code class="notion-inline-code">Published</code> 时会被 展示）</div></td></tr><tr class="notion-simple-table-row notion-block-1e917df00e714e5fb839cc60fec192a6"><td class="" style="width:116.99479675292969px"><div class="notion-simple-table-cell"><code class="notion-inline-code">type</code></div></td><td class="" style="width:46.989585876464844px"><div class="notion-simple-table-cell">是</div></td><td class="" style="width:239.00001525878906px"><div class="notion-simple-table-cell">页面类型 (博文<code class="notion-inline-code">Post</code> / 单页(<code class="notion-inline-code">Page</code>)</div></td><td class="" style="width:315.66668701171875px"><div class="notion-simple-table-cell">单页不会在博文列表显示 。</div></td></tr><tr class="notion-simple-table-row notion-block-5772722dd5ca4e7ba9fa9ae4ad382c51"><td class="" style="width:116.99479675292969px"><div class="notion-simple-table-cell"><code class="notion-inline-code">summary</code></div></td><td class="" style="width:46.989585876464844px"><div class="notion-simple-table-cell">否</div></td><td class="" style="width:239.00001525878906px"><div class="notion-simple-table-cell">内容摘要</div></td><td class="" style="width:315.66668701171875px"><div class="notion-simple-table-cell">搜索和简略显示会用到</div></td></tr><tr class="notion-simple-table-row notion-block-da1fe518618f454ebfb06167f3f03489"><td class="" style="width:116.99479675292969px"><div class="notion-simple-table-cell"><code class="notion-inline-code">date</code></div></td><td class="" style="width:46.989585876464844px"><div class="notion-simple-table-cell">否</div></td><td class="" style="width:239.00001525878906px"><div class="notion-simple-table-cell">发布日期</div></td><td class="" style="width:315.66668701171875px"><div class="notion-simple-table-cell">在V3.3.9之前的版本此项为必填。</div></td></tr><tr class="notion-simple-table-row notion-block-a745cd82bc114c8f99971033aaa27894"><td class="" style="width:116.99479675292969px"><div class="notion-simple-table-cell"><code class="notion-inline-code">category</code></div></td><td class="" style="width:46.989585876464844px"><div class="notion-simple-table-cell">否</div></td><td class="" style="width:239.00001525878906px"><div class="notion-simple-table-cell">文章分类</div></td><td class="" style="width:315.66668701171875px"><div class="notion-simple-table-cell">可以自定义</div></td></tr><tr class="notion-simple-table-row notion-block-02d9c337a401422f8b8d50c70207e6bd"><td class="" style="width:116.99479675292969px"><div class="notion-simple-table-cell"><code class="notion-inline-code">tags</code></div></td><td class="" style="width:46.989585876464844px"><div class="notion-simple-table-cell">否</div></td><td class="" style="width:239.00001525878906px"><div class="notion-simple-table-cell">文章标签</div></td><td class="" style="width:315.66668701171875px"><div class="notion-simple-table-cell">可多个，建议不要太多</div></td></tr><tr class="notion-simple-table-row notion-block-03732787272c48c4bf765b65cde7bec5"><td class="" style="width:116.99479675292969px"><div class="notion-simple-table-cell"><code class="notion-inline-code">slug</code></div></td><td class="" style="width:46.989585876464844px"><div class="notion-simple-table-cell">否</div></td><td class="" style="width:239.00001525878906px"><div class="notion-simple-table-cell">文章短路径</div></td><td class="" style="width:315.66668701171875px"><div class="notion-simple-table-cell"> (每篇文章唯一，请勿 重复）</div></td></tr><tr class="notion-simple-table-row notion-block-5cbbe9cabb0a4d648b25b966d69ad4e7"><td class="" style="width:116.99479675292969px"><div class="notion-simple-table-cell"><code class="notion-inline-code">icon</code></div></td><td class="" style="width:46.989585876464844px"><div class="notion-simple-table-cell">否</div></td><td class="" style="width:239.00001525878906px"><div class="notion-simple-table-cell">菜单栏图标(仅当<code class="notion-inline-code">Page</code>/<code class="notion-inline-code">Menu</code>类型有效)</div></td><td class="" style="width:315.66668701171875px"><div class="notion-simple-table-cell">可以参考：<a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://fontawesome.com/v6/search">图标库地址</a></div></td></tr><tr class="notion-simple-table-row notion-block-bbf9d7ea07ab4ed88ba4a93d69a896ce"><td class="" style="width:116.99479675292969px"><div class="notion-simple-table-cell"><code class="notion-inline-code">password</code></div></td><td class="" style="width:46.989585876464844px"><div class="notion-simple-table-cell"> 否</div></td><td class="" style="width:239.00001525878906px"><div class="notion-simple-table-cell"> 文章加锁</div></td><td class="" style="width:315.66668701171875px"><div class="notion-simple-table-cell"> 需要输入密码才允许访问</div></td></tr></tbody></table><div class="notion-blank notion-block-25ccd77e28e24b34a28c021499fd3eac"> </div></div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-330778472f6a4e8f9071c30a8a109f93" data-id="330778472f6a4e8f9071c30a8a109f93"><span><div id="330778472f6a4e8f9071c30a8a109f93" class="notion-header-anchor"></div><a class="notion-hash-link" href="#330778472f6a4e8f9071c30a8a109f93" title="更多说明帮助"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">更多说明帮助</span></span></h2><div class="notion-text notion-block-7aed3f17a4964fe684a3736b36bdf572">请访问教程</div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-34692355028b44e1b71115543df870bb" href="https://tangly1024.com/article/notion-next-guide"><div><div class="notion-bookmark-title">NotionNext 操作手册 | TANGLY’s BLOG</div><div class="notion-bookmark-description">介绍NotionNext的所有功能和常见问题说明</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://tangly1024.com/favicon.ico" alt="NotionNext 操作手册 | TANGLY’s BLOG" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://tangly1024.com/article/notion-next-guide</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://images.unsplash.com/photo-1587620931276-d97f425f62b9?ixlib=rb-4.0.3&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb" alt="NotionNext 操作手册 | TANGLY’s BLOG" loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-3275e52ed3d844399e741d97cf2769fa"> </div></main></div>]]></content:encoded>
        </item>
    </channel>
</rss>