File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33 "configurations" : [
44 {
55 "name" : " (gdb) Launch" ,
6+ "preLaunchTask" : " build" ,
67 "type" : " cppdbg" ,
78 "request" : " launch" ,
89 "args" : [],
Original file line number Diff line number Diff line change 1- {
2- "version" : " 2.0.0" ,
3- "tasks" : []
4- }
5- ```jsonc
6- {
7- "version" : " 2.0.0" ,
8- "tasks" : []
9- }
10- ```
11- {
12- // See https://go.microsoft.com/fwlink/?LinkId=733558
13- // for the documentation about the tasks.json format
14- "version" : " 2.0.0" ,
15- // The explicit "build" task was removed because the sample now uses a direct g++ command
16- // (the Makefile was removed). If you prefer a build task, add one that runs the
17- // appropriate g++ command for your platform or call `build.cmd` on Windows.
18- "tasks" : []
19- }
201{
212 // See https://go.microsoft.com/fwlink/?LinkId=733558
223 // for the documentation about the tasks.json format
234 "version" : " 2.0.0" ,
24- {
25- // See https://go.microsoft.com/fwlink/?LinkId=733558
26- // for the documentation about the tasks.json format
27- "version " : " 2.0.0 " ,
28- // The explicit "build" task was removed because the sample now uses a direct g++ command
29- // (the Makefile was removed). If you prefer a build task, add one that runs the
30- // appropriate g++ command for your platform or call `build.cmd` on Windows.
31- "tasks" : []
32- }
5+ "tasks" : [
6+ {
7+ "label" : " build " ,
8+ "type " : " shell " ,
9+ "group" : {
10+ "kind" : " build" ,
11+ "isDefault" : true
12+ },
13+ "presentation" : {
3314 "echo" : true ,
15+ "reveal" : " always" ,
16+ "focus" : false ,
17+ "panel" : " shared"
18+ },
19+ "windows" : {
20+ "command" : " ${workspaceRoot}/build.cmd" ,
21+ "args" : [
22+ " <Path/To/MinGW/Cygwin/Bin/Folder>" , // Path to the bin folder containing g++ to compile
23+ " fib.exe" // Output executable name
24+ ]
25+ },
26+ "linux" : {
27+ "command" : " g++" ,
28+ "args" : [
29+ " -g" ,
30+ " *.cpp" ,
31+ " -lpthread" ,
32+ " --std=c++11" ,
33+ " -o" ,
34+ " fib.out"
35+ ]
36+ },
37+ "osx" : {
38+ "command" : " g++" ,
39+ "args" : [
40+ " -g" ,
41+ " *.cpp" ,
42+ " -lpthread" ,
43+ " --std=c++11" ,
44+ " -o" ,
45+ " fib.out"
46+ ]
47+ }
48+ }
49+ ]
3450}
Original file line number Diff line number Diff line change 11# Fib
22
3- This code sample is to show debugging. Update ` launch.json ` and ` tasks.json ` in the ` .vscode ` folder to use your setup to build and debug.
4-
5- ## Building
6-
7- Use one of the commands below to build the sample. The Makefile was removed and the sample is built with g++ directly.
8-
9- ``` bash
10- # Linux / macOS
11- g++ -g * .cpp -std=c++11 -o fib.out
12-
13- # Windows (MinGW)
14- g++ -g * .cpp -std=c++11 -o fib.exe
15- ```
16-
17- On Windows you can also run the included ` build.cmd ` if you prefer (it expects the path to a MinGW/Cygwin ` bin ` folder and an output name):
18-
19- ``` powershell
20- .\build.cmd <Path\To\MinGW\Bin> fib.exe
21- ```
22-
23- After building, use the ` launch.json ` in this folder (or your own) to debug the produced binary.
24- ``` markdown
25- # Fib
26-
27- This code sample is to show debugging. Update ` launch.json ` and ` tasks.json ` in the ` .vscode ` folder to use your setup to build and debug.
28-
29- ## Building
30-
31- Use one of the commands below to build the sample. The Makefile was removed and the sample is built with g++ directly.
32-
33- ``` bash
34- # Linux / macOS
35- g++ -g * .cpp -std=c++11 -o fib.out
36-
37- # Windows (MinGW)
38- g++ -g * .cpp -std=c++11 -o fib.exe
39- ```
40-
41- On Windows you can also run the included ` build.cmd ` if you prefer (it expects the path to a MinGW/Cygwin ` bin ` folder and an output name):
42-
43- ``` powershell
44- .\build.cmd <Path\To\MinGW\Bin> fib.exe
45- ```
46-
47- After building, use the ` launch.json ` in this folder (or your own) to debug the produced binary.
48- ```
49- # Fib
50-
513This code sample is to show debugging. Update ` launch.json ` and ` tasks.json ` in the ` .vscode ` folder to use your setup to build and debug.
Original file line number Diff line number Diff line change 1- @ @ -1,2 +0,0 @ @
21SET PATH = %PATH% ;%1
3- g++ -g *.cpp -lpthread --std=c++11 -O0 -o %2
2+ g++ -g *.cpp -lpthread --std=c++11 -O0 -o %2
You can’t perform that action at this time.
0 commit comments