Uploaded image for project: 'Qt Visual Studio Tools'
  1. Qt Visual Studio Tools
  2. QTVSADDINBUG-105

moced source files are output to the same directory, prone to filename clashes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 1.1.10
    • Fix Version/s: 2.2.0
    • Component/s: General
    • Labels:
      None
    • Environment:
      MSVC2010
    • Commits:
      12c06b7262a191f8f1349dce3ff914e5232b166e

      Description

      A simple example of a source file directory structure:

      client/MyWidget.cpp
      server/MyWidget.cpp

      Normally, VS2010 outputs all object files to the same intermediate directory $(IntDir) like so:

      obj/MyWidget.obj
      obj/MyWidget.obj

      Obviously this is a problem since the first object file is overwritten by the second. The standard way to resolve this is to change "Object File Name" in "Configuration Properties -> C/C++ -> Output Files" from the default "$(IntDir)" to "$(IntDir)/%(RelativeDir)/", which gives this:

      obj/client/MyWidget.obj
      obj/server/MyWidget.obj

      Problem solved. Unfortunatly, the Qt Addin suffers from similar problems. moced source files are output to the same directory. Changing MocDirectory to ".\GeneratedFiles\$(ConfigurationName)%(RelativeDir)" doesn't resolve the problem. mocced source files are output with their directory structure intact, i.e. "GeneratedFiles/client/moc_MyWidget.cpp", but the second MyWidget.cpp file is not mocced, and "%(RelativeDir)" isn't expanded by ClCompile.

        Attachments

          Issue Links

          For Gerrit Dashboard: QTVSADDINBUG-105
          # Subject Branch Project Status CR V

            Activity

              People

              • Assignee:
                mecfc Miguel Costa
                Reporter:
                young.jpc Jonathan Young
              • Votes:
                3 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes