Vs Code Will Not Build C++ Programs With Multiple .Ccp Source Files

VS Code will not build c++ programs with multiple .ccp source files

in tasks.json:

        "label": "g++.exe build active file",
"args": [
"-g",
"${fileDirname}\\**.cpp",
//"${fileDirname}\\**.h",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe",
],

in launch.json:

"preLaunchTask": "g++.exe build active file"

it will work if your sources are in separated folder

VS Code build c++ programs with multiple .ccp source files

First make the a.out file first and change the /.vscode/lauch.json file. In that file change the "program": "whatever" to "program": "${workspaceFolder}/a.out" and if there is a "preLaunchTask": "C/C++: g++ build active file", then cut that line then press F5 and the debugger should work fine.

Check out here for more clearification.



Related Topics



Leave a reply



Submit