I started coding C++ and wanted to try in VS Code. I know it isn't the best program for that, I use VS 2019 but I wanted to try Code. I came to conclusion that VS Code builds only on .cpp file but my programs has 2 .cpp and 1 .h files. I followed Microsoft's tutorial on their site and installed all necessary programs and tools.
This is mine task.json:
{
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: g++.exe build active file",
"command": "C:\\MinGW\\bin\\g++.exe",
"args": [
"-g",
"${workspaceFolder}\\*.cpp",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "Task generated by Debugger."
}
],
"version": "2.0.0"
}
This gives me an error undefined reference to `myFunction()'
I believe that task.json is the problem here but I don't understand why isn't it working?