Class 无法确定如何正确设置vscode.json文件,以便在c++; 我尝试了几件事,但我无法在TSK.JSON和JavaStices中找到正确的设置,在VSCODE中构建和运行C++程序,同时使用另一个文件夹中的类。我的常规设置在那里(它们适用于同一文件夹中的文件): tasks.json: { "version": "2.0.0", "tasks": [ { "type": "cppbuild", "label": "C/C++: cpp.exe build active file", "command": "C:\\Program Files\\CodeBlocks\\MinGW\\bin\\cpp.exe", "args": [ "-g", "${fileWorkspaceFolder}\\*.cpp", "-o", "${fileDirname}\\${fileBasenameNoExtension}.exe" ], "options": { "cwd": "${workspaceFolder}" }, "problemMatcher": [ "$gcc" ], "group": "build", "detail": "compiler: \"C:\\Program Files\\CodeBlocks\\MinGW\\bin\\cpp.exe\"" }, { "type": "cppbuild", "label": "C/C++: g++.exe build active file", "command": "C:\\Program Files\\CodeBlocks\\MinGW\\bin\\g++.exe", "args": [ "-g", "${fileWorkspaceFolder}\\*.cpp", "-o", "${fileDirname}\\${fileBasenameNoExtension}.exe" ], "options": { "cwd": "${workspaceFolder}" }, "problemMatcher": [ "$gcc" ], "group": { "kind": "build", "isDefault": true }, "detail": "compiler: \"C:\\Program Files\\CodeBlocks\\MinGW\\bin\\g++.exe\"" } ] }

Class 无法确定如何正确设置vscode.json文件,以便在c++; 我尝试了几件事,但我无法在TSK.JSON和JavaStices中找到正确的设置,在VSCODE中构建和运行C++程序,同时使用另一个文件夹中的类。我的常规设置在那里(它们适用于同一文件夹中的文件): tasks.json: { "version": "2.0.0", "tasks": [ { "type": "cppbuild", "label": "C/C++: cpp.exe build active file", "command": "C:\\Program Files\\CodeBlocks\\MinGW\\bin\\cpp.exe", "args": [ "-g", "${fileWorkspaceFolder}\\*.cpp", "-o", "${fileDirname}\\${fileBasenameNoExtension}.exe" ], "options": { "cwd": "${workspaceFolder}" }, "problemMatcher": [ "$gcc" ], "group": "build", "detail": "compiler: \"C:\\Program Files\\CodeBlocks\\MinGW\\bin\\cpp.exe\"" }, { "type": "cppbuild", "label": "C/C++: g++.exe build active file", "command": "C:\\Program Files\\CodeBlocks\\MinGW\\bin\\g++.exe", "args": [ "-g", "${fileWorkspaceFolder}\\*.cpp", "-o", "${fileDirname}\\${fileBasenameNoExtension}.exe" ], "options": { "cwd": "${workspaceFolder}" }, "problemMatcher": [ "$gcc" ], "group": { "kind": "build", "isDefault": true }, "detail": "compiler: \"C:\\Program Files\\CodeBlocks\\MinGW\\bin\\g++.exe\"" } ] },class,visual-studio-code,directory,Class,Visual Studio Code,Directory,和properties.json文件: { "configurations": [ { "name": "Win32", "includePath": [ "${default}" ], "defines": [ "_DEB

和properties.json文件:

{
"configurations": [
    {
        "name": "Win32",
        "includePath": [
            "${default}"
            
        ],
        "defines": [
            "_DEBUG",
            "UNICODE",
            "_UNICODE"
        ],
        "compilerPath": "C:\\Program Files\\CodeBlocks\\MinGW\\bin\\gcc.exe",
        "cStandard": "gnu17",
        "cppStandard": "gnu++14",
        "intelliSenseMode": "windows-gcc-x64"
    }
],
"version": 4
}
因此,我尝试在properties.json中包含“C:\Users\nikoa\Desktop\vscode\Array\”,includePath,当我尝试包含它时,它似乎可以识别该类,但当我尝试构建它时,它失败了。我搞不懂的是如何正确设置任务文件。有什么帮助吗?谢谢大家!