背景:虽说用eclipse CDT、vi编辑挺顺手,考虑到Visual Studio支持直接上云,同时促使自己看看新鲜玩意,紧跟潮流(也可说跟风)花点时间安装一下Visual Studio Code。
过程:官方文档没有直接描述如何在Fedora31上安装的文档,用bing搜索了一下,还是没找到。遂参考https://code.visualstudio.com/docs/cpp/config-mingw后安装如下。
1. 一下
download code-1.40.1-1573664332.el7.x86_64.rpm
https://code.visualstudio.com/docs/?dv=linux64_rpm
2. 二装
sudo dnf install code-1.40.1-1573664332.el7.x86_64.rpm
3. 三配
3. 1、Create a workspace
mkdir firstproject; cd firstproject; mkdir helloworld; cd helloworld; code .
3. 2、Configure the compiler path
Press Ctrl+Shift+Pto open the Command Palette. tart typing "C/C++" and then choose Edit Configurations (UI) from the list of suggestions.
3. 3、Create a build task
Next, create atasks.jsonfile to tell VS Code how to build (compile) the program. This task will invoke the g++ compiler to create an executable file based on the source code.
引用:
https://docs.microsoft.com/en-us/cpp/linux/download-install-and-setup-the-linux-development-workload?view=vs-2019