microsoft / microsoft/vscode-cpptools
Unable to use problemMatcher with GNU make and relative folder
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
Description
Type: LanguageService
Describe the bug
- OS and Version: Linux Opensuse Tumbleweed
- VS Code Version: 1.53.2
- C/C++ Extension Version:1.2.2
- Other extensions you installed (and if the issue persists after disabling them):N/A
- Does this issue involve using SSH remote to run the extension on a remote machine?:No
In my project, i have :
PROJECT/
Makefile
folder1/source.c
folder2/source.c
...
build/
The Makefile process the compilation steps (ie mainly gcc calls) and stores the results in the build subfolder.
I configured a tasks.json :
{
"label": "Relase x64",
"type": "shell",
"command": "make -f Makefile config=release_linux64",
"options": {
"cwd": "${workspaceFolder}"
},
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"reveal": "always"
},
"problemMatcher": [ {
"base": "$gcc",
"fileLocation": ["relative", "${workspaceFolder}/build/"]
}
]
},
The compilation task is working properly, but it cannot parse/open the files in case of errors :

Please note that i tried with custom patterns, etc, etc : always the same result, the file is never properly parsed.
Steps to reproduce
1 - Setup a project kile the one above.
2 - Create a makefile with compilation in a subfolder
3 - When source files have reltive path with ../ it does not work
Expected behavior
When clicking in a file with a compilation error, it should jump to it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the problem with the described project layout, Makefile, tasks.json, and the $gcc problemMatcher using relative paths from the build folder. Start by tracing how the task output resolves ../ source paths; done means clicking a compilation error opens the correct source file. No implementation file or test is identified in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, vscode
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100