1.頭檔案找不到
基本不用改多少東西
找不到頭檔案是因為c_cpp_properties.json中includepath你沒有修改為你安裝的mingw或者其他編譯器的頭檔案和庫的位置

2.大多編譯失敗都是gcc、gdb、g++沒有加入環境變數(或者在tasks.json和launch.json檔案中沒有修改下圖帶有文字注釋的地方):
tasks.json
代碼:
"tasks": [ {
"type": "cppbuild",
"label": "C/C++: g++.exe build active file", "command": "C:\\msys64\\mingw32\\bin\\g++.exe",
/*這里是g++的位置,編譯器的gcc、gdb、
g++都需要加入環境變數pash中,
大多問題都是這三個沒有加入環境變數, */
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build"
"isDefault": true
},
"detail": "Task generated by Debugger."
} ],
"version": "2.0.0"

launch.json
代碼:
{
"version": "0.2.0",
"configurations": [{ "name": "g++.exe - 生成和除錯活動檔案",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd":"${workspaceFolder}",
"environment": [],
"externalConsole": true,//是否顯示運行視窗
"MIMode": "gdb",
"miDebuggerPath": "c:\\msys64\\mingw32\\bin\\gdb.exe", /*這里是gdb的位置,編譯器的
gcc、gdb、g++都需要加入環境變數pash中,
大多問題都是這三個沒有加入環境變數, */ "setupCommands": [ {
"description": "為 gdb 啟用整齊列印",
"text": "-enable-pretty-printing", "ignoreFailures": true}
],
"preLaunchTask": "C/C++: g++.exe build active file" } ]}

我遇到的就這倆問題,如果有其他問題歡迎留言
樂意效勞(其實我會的也就這點)但是我愿意解決其他可能遇到的問題
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/252726.html
標籤:區塊鏈
上一篇:簡單寫寫安全多方計算
