Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt Creator 2.4.0 Intel Compiler Error Parsing under Windows
Qt 6.11 is out! See what's new in the release blog

Qt Creator 2.4.0 Intel Compiler Error Parsing under Windows

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 3.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Taron2000
    wrote on last edited by
    #1

    Hello folks,

    I´m developing under Windows with the newest Intel Compiler (Ver. 12.1.2.278) and using the Qt Creator 2.4.0.
    Once you have set up your compiler to work with Qt Creator you will soon find the the error parsing does not work properly (at least for me). Sadly I found no option in the Qt Creator that allows me to set parsing parameters for my compiler. So I downloaded the Qt Creator source and found the parserfiles in the projectexplorer project. As my Creator uses the msvc Toolchain it uses the msvcparser.cpp to parse the errors. With some little changes it will parse the intel compiler errors and warnings. But this is a quick and dirty fix not tested well. At the moment it will not work with the Microsoft compiler nor will it parse the linker Errors. But this can be easily achieved by modifying the QRegExps. After changing you youst have to build the projectexplorer.dll and replace it with the old one. Hopes this helps anyone.

    Code: msvcparser.cpp located at ..\qt-creator-2.4.0-src\src\plugins\projectexplorer

    @static const char FILE_POS_PATTERN[] = "(cl|icl|LINK|.+): ";
    static const char ERROR_PATTERN[] = ":";

    static QPair<QString, int> parseFileName(const QString &input)
    {
    QString fileName = input;
    if (fileName.startsWith(QLatin1String("LINK"))
    || fileName.startsWith(QLatin1String("cl"))
    || fileName.startsWith(QLatin1String("icl")))
    return qMakePair(QString(), -1);

    // Extract linenumber (if it is there):
    int linenumber = -1;
    if (fileName.endsWith(QLatin1Char(')'))) {
        int pos = fileName.lastIndexOf(QLatin1Char('('));
        if (pos >= 0) {
            bool ok = false;
            int n = fileName.mid(pos + 1, fileName.count() - pos - 2).toInt(&ok);
            if (ok) {
                fileName = fileName.left(pos);
                linenumber = n;
            }
        }
    }
    
    return qMakePair(fileName, linenumber);
    

    }

    using namespace ProjectExplorer;

    MsvcParser::MsvcParser()
    {
    setObjectName(QLatin1String("MsvcParser"));
    m_compileRegExp.setPattern(QString::fromLatin1("^") + QLatin1String(FILE_POS_PATTERN)
    + QLatin1String("(Command line |fatal |catastrophic )?(warning|error)(")
    + QLatin1String(ERROR_PATTERN) + QLatin1String(".)$"));
    m_compileRegExp.setMinimal(true);
    m_additionalInfoRegExp.setPattern(QString::fromLatin1("^ (.
    )\((\d+)\) : (.*)$"));
    m_additionalInfoRegExp.setMinimal(true);
    }@

    Again. This is a dirty fix. One can do it better, but unfortunately i dont have more time to spend on this.
    Maybe with this it would run with both compilers icl & cl, but not tested:
    @static const char ERROR_PATTERN[] = "(:|[A-Z]\d\d\d\d ?:)";@
    @ + QLatin1String("(Command line |fatal |catastrophic )?(warning|error) ?(")@

    If someone develops a the parser that works with both compilers (under windows) and linkers it would be nice to share it with us here.

    So long

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tobias.hunger
      wrote on last edited by
      #2

      I would be happy to add support for intel compilers, but this is just too dirty a hack!

      Note that already is (limited) support for linux ICC. Maybe that could get extended to work on windows as well. I am not familiar with the compiler, so I am not sure.

      If you seriously consider to help with adding support for new compilers, please provide unit tests for the parsers. Without good unit test coverage it is really impossible to update the QRegExp!

      1 Reply Last reply
      0
      • T Offline
        T Offline
        Taron2000
        wrote on last edited by
        #3

        I know its a dirty hack and I'm not happy with it. Like I said, I'm very busy at the moment and can not estimate when i can find time to make it clean with an extensive unit-test. Because of that I shared this hack, for people who relly want this and maybe someone will do the time-consuming work :).

        1 Reply Last reply
        0
        • T Offline
          T Offline
          tobias.hunger
          wrote on last edited by
          #4

          I appreciate your posting, it is just that I wanted to point out what needs to be done to get this into our codebase.

          I don't want people telling me "there is a patch on devnet for ages, so why is that not in Qt Creator x.y.z" :-)

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved