当前位置:网站首页>VSCode+mingw64
VSCode+mingw64
2022-07-07 09:25:00 【heater404】
This article records in Windows The configuration VSCode Use MinGW Of g++ The compiler and GBD The debugger . The official tutorial is :Get Started with C++ and Mingw-w64 in Visual Studio Code
One 、 Installation preparation
install VSCode And C/C++ Extension plug-ins ; install MinGW64 And set the environment variable . No introduction here , Refer directly to the official tutorial .
Two 、 compile
Follow the operation sequence in the above figure , We will find that in the .vscode There is one more... In the folder tasks.json file . The contents of the document are as follows :
About more tasks.json Documents can refer to :Tasks in Visual Studio Code.
About more tasks.json The variables in the file can be referred to :Visual Studio Code Variables Reference.
We will change the compilation output directory to :"${fileDirname}\bin\${fileBasenameNoExtension}.exe". And then found out in bin There are executable files we want in the directory , You can use the terminal to run .
3、 ... and 、 debugging
After the above operation , Can be in .vscode It was found in the file that launch.json File generation .
And then use F5 You can debug breakpoints .
Four 、C/C++ To configure
In the command panel , Enter and select C/C++ Edit the configuration (UI), Will pop up C/C++ Configuration page . And then in .vscode In the folder, you will find the generation c_cpp_properties.json file .
If the header file used in the program is not in the workspace or the path of the standard header file , Can be in Include path Add search path in .
5、 ... and 、 Multi file compilation and debugging
For the compilation of multiple files , We need to change tasks.json In file args Parameters : take " f i l e " repair Change by " f{ile}" It is amended as follows " file" repair Change by "{fileDirname}\*.cpp".${fileDirname}- It refers to the currently open file directory , So the above parameter refers to test.cpp All under the directory of the file cpp file . Be careful , If in test.cpp There are... In the folder under the directory cpp There is no way to find the document , Must be with test.cpp Same directory .
If there are multiple folders cpp The file needs to be compiled , I don't know how to write this directory parameter ....
But for multi file compilation, it seems that you need to use cmake 了 . You can read this article :VSCode+mingw64+cmake
边栏推荐
- 【SVN】SVN是什么?怎么使用?
- DRF authentication, permissions, and flow restrictions (only for views in DRF)
- NATAPP内网穿透
- Postman data driven
- Add new item after the outbound delivery order of SAP mm sto document is created?
- Connecting mobile phone with ADB
- E-commerce campaign Guide
- When inputting an expression in the input box, an error is reported: incorrect string value:'\xf0\x9f... ' for column 'XXX' at row 1
- Nested (multi-level) childrn routes, query parameters, named routes, replace attribute, props configuration of routes, params parameters of routes
- 信息安全实验三 :PGP邮件加密软件的使用
猜你喜欢
What are the conditions for applying for NPDP?
flex弹性布局
Locust performance test 3 (high concurrency, parameter correlation, assembly point)
Cesium does not support 4490 problem solution and cesium modified source code packaging scheme
Yapi test plug-in -- cross request
Using JWT to realize login function
Skill review of test engineer before interview
Upgrade Alibaba cloud RDS (relational database service) instance to com mysql. jdbc. exceptions. Troubleshooting of jdbc4.communicationsexception
PMP examination experience sharing
Pytest installation (command line installation)
随机推荐
嵌套(多级)childrn路由,query参数,命名路由,replace属性,路由的props配置,路由的params参数
Final keyword
Implementation of corner badge of Youmeng message push
LeetCode每日一题(2316. Count Unreachable Pairs of Nodes in an Undirected Graph)
消费互联网的产业链其实是很短的,它仅仅承接平台上下游的对接和撮合的角色
C language pointer (Part 2)
Original collection of hardware bear (updated on May 2022)
Leetcode daily questions (2316. count unreachable pairs of nodes in an undirected graph)
Integer or int? How to select data types for entity classes in ORM
章鱼未来之星获得25万美金奖励|章鱼加速器2022夏季创业营圆满落幕
Unittest simple project
How can I apply for a PMP certificate?
SAP MM STO单据的外向交货单创建后新加ITEM?
Information Security Experiment 3: the use of PGP email encryption software
liunx命令
答案在哪里?action config/Interceptor/class/servlet
PMP examination experience sharing
Storage of data in memory
[chaosblade: node CPU load, node network delay, node network packet loss, node domain name access exception]
Regular matching starts with XXX and ends with XXX