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

MSVS2017: Classes with "Debug" in (file)name breaks build

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 2.2.0
    • 2.1.2
    • General
    • None
    • 34f18d8347177d4233056999de0b007043f87ff2

    Description

      For MSVS2017, when adding a class or filename with the name "Debug", for example for "DebugTest.cpp", typically the following XML is generated in the .vcxproj:

      <ClCompile Include="GeneratedFiles\Debug\moc_DebugTest.cpp">
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
      </ClCompile>
      
      <ClCompile Include="GeneratedFiles\Release\moc_DebugTest.cpp">
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
      </ClCompile>

       

      The first time, when the file has just been added, this is what is added.

      However, when editing DebugTest.cpp and saving, the 'Release' XML is replaced with:

      <ClCompile Include="GeneratedFiles\Release\moc_DebugTest.cpp" />

      Thus removing the ExcludedFromBuild tag, and will now cause Debug builds to fail compilation as both the Debug and Release moc_DebugTest.cpp will be compiled:

      1>DebugTest.cpp
      1>moc_DebugTest.cpp
      1>moc_DebugTest.cpp
      1>c1xx : fatal error C1083: Cannot open source file: 'GeneratedFiles\Release\moc_DebugTest.cpp': No such file or directory.

       

      This only happens if the filename has the keyword "Debug" in it.

      Attachments

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

        Activity

          People

            mecfc Miguel Costa
            bameye bameye
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes