MinGWをインストールし、VSCodeのターミナルでC++のファイルをコンパイルできるようにしようとしましたがうまくいきません。エラー文からターミナル上ではMinGW(g++)を認識できていないのではないかと思うのですがどうすれば良いのかわからないです。どうかよろしくお願いします。
C++
1コード{ 2===============実行ファイル:AtCoderPlactice1.cpp====================== 3#include<iostream> 4 5using namespace std; 6 7int main(){ 8 int a; 9 cin >> a; 10 11 int b,c; 12 cin >> b >> c; 13 14 string s; 15 cin >> s; 16 17 cout << (a+b+c) << " " << s << endl; 18 19 return 0; 20} 21 22 23 24 25===============ファイル名:launch.json=============== 26 27 "version": "0.2.0", 28 "configurations": [ 29 { 30 "name": "(gdb) Launch", 31 "type": "cppdbg", 32 "request": "launch", 33 "program": "enter program name, for example ${workspaceFolder}/a.exe", 34 "args": [], 35 "stopAtEntry": false, 36 "cwd": "${workspaceFolder}", 37 "environment": [], 38 "externalConsole": true, 39 "MIMode": "gdb", 40 "miDebuggerPath": "C:\MinGW\bin\gdb.exe", 41 "setupCommands": [ 42 { 43 "description": "Enable pretty-printing for gdb", 44 "text": "-enable-pretty-printing", 45 "ignoreFailures": true 46 } 47 ] 48 } 49 ] 50} 51 52 53===============ファイル名:tasks.json================= 54 55{ 56 // See https://go.microsoft.com/fwlink/?LinkId=733558 57 // for the documentation about the tasks.json format 58 "version": "2.0.0", 59 "tasks": [ 60 { 61 "label": "build AtCoderPlactice", 62 "type": "shell", 63 "command": "g++", 64 65 "args": [ 66 "-g", "-o", "${fileDirname}/${fileBasenameNoExtension}.out", "${file}", 67 ], 68 "group": { 69 "kind": "build", 70 "isDefault": true, 71 } 72 }, 73 ] 74} 75 76 77===============ファイル名:settings.json================= 78{ 79 "window.zoomLevel": -1, 80 "editor.suggestSelection": "first", 81 "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue", 82 83 "C_Cpp.default.includePath": [ 84 "C:\MinGW\include", 85 "C:\MinGW\lib\gcc\mingw32\8.2.0\include\c++", 86 "C:\MinGW\lib\gcc\mingw32\8.2.0\include\c++\mingw32" 87 ], 88 "C_Cpp.default.compilerPath": "C:\MinGW\bin\g++.exe", 89 "C_Cpp.default.cppStandard": "c++14", 90 "C_Cpp.default.intelliSenseMode": "gcc-x64", 91 92 93} 94 95 96==================ターミナルの表示=================== 97 Executing task: g++ -g -o c:\Users\coop\Documents\AtCoder\Plactice/AtCoderPlactice1.out c:\Users\coop\Documents\AtCoder\Plactice\AtCoderPlactice1.cpp < 98 99g++ : 用語 'g++' は、コマンドレット、関数、スクリプト ファイル、または操作可能なプログラムの名前として認識されません。名前が正しく記述されていることを確認し、パスが含まれている場合はそのパスが正しいこ 100とを確認してから、再試行してください。 101発生場所 行:1 文字:1 102+ g++ -g -o c:\Users\coop\Documents\AtCoder\Plactice/AtCoderPlactice1.o ... 103+ ~~~ 104 + CategoryInfo : ObjectNotFound: (g++:String) [], CommandNotFoundException 105 + FullyQualifiedErrorId : CommandNotFoundException 106 107ターミナルの処理が終了しました (終了コード: 1) 108 109
回答1件
あなたの回答
tips
プレビュー