Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-25663

C++: Choosing the name of a std class as a qtCreator project name results in stray errors when including the appropriate std header

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: Qt Creator 4.11.0
    • Fix Version/s: None
    • Component/s: C/C++/Obj-C++ Support
    • Labels:
      None
    • Environment:
      Ubuntu 20.04.2 LTS + qtCreator 4.11.0
    • Platform/s:
      Linux/X11

      Description

      I identified an interesting problem while working with qtCreator / C++:

      Problem

      When trying to build a C++ application a lot of stray errors occur. Compilation does not stop such that hundreds of stray errors occur. The only way is to kill qtCreator as it will stop to react to input.

      Cause/Reproduction

      I found some posts like this (https://stackoverflow.com/questions/4897661/qtcreator-a-big-lot-of-stray-errors) which mention invalid encodings. However, I was unable to solve the problem and verified that my files have no "hidden characters".

       

      After a lot of trial and error I figured out how to reproduce this error:

       

      Screenshot 01: Create a new plain C++ application.

      Screenshot 02:  Choose a class which is part of the C++ standard as project name. I tested it with "string", "map" and "set". All of these names belong to C++ classes which are part of std. 

      Screenshot 03: Compile&Run: Everything works fine

      Screenshot 04: If you include the header of the class which you have chosen as your qt project (in my case "set", see line 7) and try to build, you will get stuck in the endless "stray"-error loop.

       

       

       

        Attachments

        1. 01 plain c++.PNG
          01 plain c++.PNG
          47 kB
        2. 02 project name.PNG
          02 project name.PNG
          36 kB
        3. 03 runs fine.PNG
          03 runs fine.PNG
          28 kB
        4. 04 adding set.PNG
          04 adding set.PNG
          109 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            kandeler Christian Kandeler
            Reporter:
            codehs First Last
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes