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

for excluded source files we still compile moc_*.cpp

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 1.1.6
    • 1.2.1
    • General
    • None
    • 69de679bbeeb66aa945e4ab2418a98c06a5adb72

    Description

      Steps to reproduce / test case
      1) Create a new Qt Application project. Use standard settings.
      2) Exclude the following files from build (these files were automatically created):

      {projectname}.cpp and {projectname}

      .h (right click on file, properties, yes to exclude from build)
      3) Fix main.cpp so it no longer uses code from

      {projectname}

      .h
      4) Compiling the projects will now result in an error.

      When excluding a file from the build, visual studio will still try to compile the moc file that would have been generated if it was included in the build.

      Compiler output:
      ----------------

      1>------ Build started: Project: Bug, Configuration: Debug Win32 ------
      1>Compiling...
      1>moc_bug.cpp
      1>c1xx : fatal error C1083: Cannot open source file: '.\GeneratedFiles\Debug\moc_bug.cpp': No such file or directory
      1>qrc_bug.cpp
      1>Generating Code...
      1>Build log was saved at "...\Documents\Visual Studio 2008\Projects\Bug\Bug\Debug\BuildLog.htm"
      1>Bug - 1 error(s), 0 warning(s)
      ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

      Observations:
      -------------

      When removing the Q_OBJECT declaration from bug.h it compiles without errors. However this can not be used as a workaround since the file might be used (not excluded from the build) in a different build configuration.

      Attachments

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

        Activity

          People

            owolff Oliver Wolff
            jbornema Joerg Bornemann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes