QtCreator: How to make builderrors from cmake->ninja show in issues panel in "Makefile project"

Viewed 140

I use qtcreator and have imported my project with New->Import Existing Project (this is the kind of project i need help with).

When compiling and having errors, the error messages shows up in the "Compile Output"-panel like so:

In file included from ../../src/tasklist.cpp:1:
../../src/tasklist.h:74:9: error: expected member name or ';' after declaration specifiers

But because file paths is specified relative to the build path and not to the root path, qtcreator fails to parse the messages and put annotations in code and in the "Issues"-panel. This slows work considerably compared to having the errors marked out by the editor.

How do I make qtcreator recognize the paths in the error message?

I'm running ubuntu, but the problem exists also when i compile with ninja in windows.

I have tried to write a custom error matcher, that picks up the pattern in the editor view, but it does not seem to run, when building. The build is also set to the directory where the compiler messages assumes that you originate from.

1 Answers

I've currently got it working with the following custom error message capture pattern:

(.*):(\d+):\d+: error: (.*)

My build folder is in a custom location, so I believe it's handling the file paths correctly.

If the parser doesn't seem to be running at all, then I don't think the file paths are the problem. For example, if I change my custom parser so the filename and line number are swapped, the parser still runs, but when I double-click the issue in the "Issues" panel, it says something like "File not found: 5". So, if the file paths are the only problem, it should still parse into issues.

Related