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

    • Bug
    • Resolution: Done
    • P2: Important
    • 2.2.0
    • 1.1.10
    • General
    • None
    • MSVC2010
    • 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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              mecfc Miguel Costa
              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