網(wǎng)站頂部小圖標怎么做品牌推廣與傳播方案
在Ubuntu系統(tǒng)下配置C++環(huán)境,并運行helloworld
1. 下載VScode
我這里使用的是星火應用商店,在商店里面可以直接下載安裝
http://spark-app.store/
2.創(chuàng)建文件夾
3.啟動VScode并打開該文件夾
4.安裝以下幾個擴展
PS:Clang這個插件別安裝!!
5.點擊文件夾,創(chuàng)建一個helloworld.cpp并輸入以下代碼,F5運行
#include<iostream>
using namespace std;int main(int a){cout<<"helloworld"<<endl;return 0;
}
6.在跳出的提示框里選擇“打開launch.json”
把launch.json里的代碼刪除,用以下代碼替代,F5運行
// Use IntelliSense to learn about possible attributes.// Hover to view descriptions of existing attributes.// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387"version": "0.2.0","configurations": [{"name": "(gdb) Launch","type": "cppdbg","request": "launch","program": "${workspaceFolder}/${fileBasenameNoExtension}.out","args": [],"stopAtEntry": false,"cwd": "${workspaceFolder}","environment": [],"externalConsole": true,"MIMode": "gdb","preLaunchTask": "build","miDebuggerArgs": "-q -ex quit; wait() { fg >/dev/null; }; /usr/bin/gdb -q --interpreter=mi","setupCommands": [{"description": "Enable pretty-printing for gdb","text": "-enable-pretty-printing","ignoreFailures": true}]}]
}
7.在跳出的提示框里選擇“配置任務”
使用模板創(chuàng)建——others,創(chuàng)建出tasks.json,用以下代碼替換內(nèi)容
{// See https://go.microsoft.com/fwlink/?LinkId=733558// for the documentation about the tasks.json format"version": "2.0.0","tasks": [{"label": "build","type": "shell","command": "g++","args": ["-g", "${file}", "-std=c++11", "-o", "${fileBasenameNoExtension}.out"]}]
}