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

adding .cpp and .h files that are already in the project results in double entries in the .pro file

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • Qt Creator 4.9.0-beta1
    • Qt Creator 4.5.0
    • Windows 7, Qt Creator 4.5.0 based on Qt 5.10.0 (MSVC 2015, 32 bit)
    • 749bc50e1b2202846730d636d4d969bba3f24c82 (qt-creator/qt-creator/4.9)

    Description

      I was working on a Qt project where some .cpp and .h files were not included in the .pro file, resulting in cpp files not being compiled, and then linker errors as a result. That's as expected.

      To fix this, I right-clicked on the project in Qtcreator, and have choosen "Add existing files". Then i just selected all .cpp and .h files from the source directory. The list of files in Qtcreator then shows all the .cpp and .h files. On compile, I got a lot of "symbol redefined" errors. In the .pro file, a lot of .h and .cpp files are double listed in the .pro file. To fix this, i removed all the existing entries, and added all the .cpp and .h files again, and now the Qt program compiles and runs perfectly.

      It looks like QtCreator does not check if a file is already added to the project.

      Attachments

        Issue Links

          For Gerrit Dashboard: QTCREATORBUG-19546
          # Subject Branch Project Status CR V

          Activity

            People

              kandeler Christian Kandeler
              cdwijs cdwijs
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes