Custom Error Parsing Problem
-
Qt Creator 4.5.1
Based on Qt 5.9.4 (GCC 7.3.1 20180130 (Red Hat 7.3.1-2), 64 bit)
Fedora 27 PCI am trying to implement custom error parsing for a GreenHills compiler in qtcreator. I have added the custom compilers and configured their custom error parsing successfully thus far (or at least I thought). I am actually getting warning/errors in my issues pane. However, when I click on the warnings/errors in the issue pane, qtcreator cannot find the file. The path is correct, but it is relative to the project directory, and it looks as if qtcreator is attempting an absolute path (which it does indicate in the console output).
Could not find absolute location of file "\"[relative_path_to_my_source_file\", line 135"
Any ideas on how to resolve this?
-
Tools->Options->Build & Run, Select Compilers tab. Selected "Compilers" tab, clicked on "Add", dropped down to "Custom", and selected "C". At the bottom of that dialogue is an entry for an Error Parser. I selected "Custom" and clicked on "Custom Parser Settings..." Custom parser settings are as follows.
And yes, I did utilize the parser testing area to get it right. Before I implemented these error parser changes, I could not get warnings/errors to show up in my issues pane. With these changes, they do show up. Qtcreator wants to use an absolute file path for whatever reason.
-
@qtenvy said in Custom Error Parsing Problem:
And yes, I did utilize the parser testing area to get it right.
Ok, just wanted to ask before guessing a lot :)
Before I implemented these error parser changes, I could not get warnings/errors to show up in my issues pane. With these changes, they do show up.
Good, looks like halfway through.
Qtcreator wants to use an absolute file path for whatever reason.
It does work with relative paths (I've implemented the custom parser, after all), but you have to see if the build directory is different from the source directory? Which build directory is set in Projects -> Build Settings -> General?
I know that e.g. for the QMake projects Creator tracks the "entering directory" outputs; that is afaik not available for the custom toolchain. So all your relative paths have to be relative to the build directory.
Regards.
-
Thanks for helping out BTW.
Yes, the build directory is set, and the relative path output to the issues pane is perfectly relative to that build directory. Again, it is as if QtCreator completely ignores the build directory for custom error parsers.
I invoke qtcreator from a command terminal. When I build (with an error present), I get the following output in that terminal window.
Could not find absolute location of file "\"a/path/to/my/source/file/why_is_qt_creator_broke.c\""
-
Please create a report at https://bugreports.qt.io/projects/QTCREATORBUG and provide as much information as possible (e.g. the compile output and the issues pane, also your terminal window output).
It is possible that this function broke recently - we'll have to investigate what happened.
Thanks.
-
This lead to QTCREATORBUG-20605, please use that for further tracking.
Therefore closing this topic.