当前位置:网站首页>VSCode关于C语言的3个配置文件
VSCode关于C语言的3个配置文件
2022-07-07 15:40:00 【Larry Chow】
在cmd.exe中输入如下命令:
gcc -v -E -x c++ -

当用vscode打开文件夹,会自动创建.vscode文件夹,在该文件夹中,创建3个配置文件,分别是c_cpp_properties.json、launch.json、tasks.json。
将红框中的信息在配置文件中,做替换。
在c_cpp_properties.json中
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceRoot}",
"D:/programFiles/MinGW/include/**",
"D:/programFiles/MinGW/bin/../lib/gcc/mingw32/6.3.0/include/c++",
"D:/programFiles/MinGW/bin/../lib/gcc/mingw32/6.3.0/include/c++/mingw32",
"D:/programFiles/MinGW/bin/../lib/gcc/mingw32/6.3.0/include/c++/backward",
"D:/programFiles/MinGW/bin/../lib/gcc/mingw32/6.3.0/include",
"D:/programFiles/MinGW/bin/../lib/gcc/mingw32/6.3.0/../../../../include",
"D:/programFiles/MinGW/bin/../lib/gcc/mingw32/6.3.0/include-fixed"
],
"defines": [
"_DEBUG",
"UNICODE",
"__GNUC__=6",
"__cdecl=__attribute__((__cdecl__))"
],
"intelliSenseMode": "msvc-x64",
"browse": {
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": "",
"path": [
"${workspaceRoot}",
"D:/programFiles/MinGW/include/**",
"D:/programFiles/MinGW/bin/../lib/gcc/mingw32/6.3.0/include/c++",
"D:/programFiles/MinGW/bin/../lib/gcc/mingw32/6.3.0/include/c++/mingw32",
"D:/programFiles/MinGW/bin/../lib/gcc/mingw32/6.3.0/include/c++/backward",
"D:/programFiles/MinGW/bin/../lib/gcc/mingw32/6.3.0/include",
"D:/programFiles/MinGW/bin/../lib/gcc/mingw32/6.3.0/../../../../include",
"D:/programFiles/MinGW/bin/../lib/gcc/mingw32/6.3.0/include-fixed"
]
}
}
],
"version": 4
}在launch.json中
{
"version": "0.2.0",
"configurations": [
{
"name": "(Windows) Launch",
"type": "cppvsdbg",
"request": "launch",
"program": "cmd",
"preLaunchTask": "echo",
"args": [
"/C",
"${fileDirname}\\${fileBasenameNoExtension}.exe",
"&",
"echo.",
"&",
"pause"
],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole":true
},
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"miDebuggerPath": "C:\\Program Files\\mingw64\\bin\\gdb.exe",// 自己电脑的gdb
"preLaunchTask": "echo",//这里和task.json的label相对应
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}在tasks.json中:
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "echo",
"type": "shell",
"command": "gcc",
"args": [
"-g",
"${file}",
"-o",
"${fileBasenameNoExtension}.exe",
"-fexec-charset=GBK"//解决中文乱码
]
}
],
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": false
}
}边栏推荐
- L1-023 输出GPLT(Lua)
- Skimage learning (3) -- adapt the gray filter to RGB images, separate colors by immunohistochemical staining, and filter the maximum value of the region
- On Apache Doris Fe processing query SQL source code analysis
- Matplotlib绘图界面设置
- Solid function learning
- L1-028 判断素数(Lua)
- Mrs offline data analysis: process OBS data through Flink job
- [video / audio data processing] Shanghai daoning brings you elecard download, trial and tutorial
- 99%的人都不知道|私有化部署还永久免费的即时通讯软件!
- [source code interpretation] | source code interpretation of livelistenerbus
猜你喜欢

NeRF:DeepFake的最终替代者?

Nerf: the ultimate replacement for deepfake?

How to add aplayer music player in blog

命令模式 - Unity

Skimage learning (2) -- RGB to grayscale, RGB to HSV, histogram matching

Linux 安装mysql8.X超详细图文教程

Sator launched Web3 game "satorspace" and launched hoobi

本周小贴士#136:无序容器

鲲鹏开发者峰会2022 | 麒麟信安携手鲲鹏共筑计算产业新生态

Siggraph 2022 best technical paper award comes out! Chen Baoquan team of Peking University was nominated for honorary nomination
随机推荐
责任链模式 - Unity
mysql官网下载:Linux的mysql8.x版本(图文详解)
【黄啊码】为什么我建议您选择go,而不选择php?
状态模式 - Unity(有限状态机)
LeetCode 152. Product maximum subarray daily question
On Apache Doris Fe processing query SQL source code analysis
Skimage learning (2) -- RGB to grayscale, RGB to HSV, histogram matching
Flask搭建api服务-生成API文档
Devops' operational and commercial benefits Guide
LeetCode 497(C#)
LeetCode 648(C#)
Flask build API service SQL configuration file
LeetCode 515(C#)
Siggraph 2022 best technical paper award comes out! Chen Baoquan team of Peking University was nominated for honorary nomination
Linux 安装mysql8.X超详细图文教程
LeetCode 1626. The best team without contradiction
Seaborn data visualization
麒麟信安操作系统衍生产品解决方案 | 存储多路径管理系统,有效提高数据传输可靠性
Number of exchanges in the 9th Blue Bridge Cup finals
如何在博客中添加Aplayer音乐播放器