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

Linker Errors in Visual Studio Projects with Win32+x64 Configuration Due to MOC Steps

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P3: Somewhat important
    • 1.1.11
    • 1.1.6
    • General
    • Windows XP

    Description

      Here I include the steps how to accuratly reproduce my problem and to see what my problem is:

      1.) Prequesites

      Have Visual Studio 2005 installed with x64 compilers and with Qt Add-in installed. A 32-bit and a 64-bit build of Qt is required. Register at least one of the builds in the Qt Add-in.

      2.) Create new Qt project with Visual Studio 2005

      Select "File->New Project.." from the menu. Select "Qt4 Projects->Qt Application" from the dialog and enter "test" as name. Leave all Qt settings as default.

      3.) Add x64 platform

      Click on "Win32" in the toolbar and open the configuration manager via "Configuration Manager...".
      In the configuration manager click on "Win32" in "Active solution platform" and select "<New...>".
      In the new solution platform select "x64" and create the new platform configuration.

      4.) Trigger MOC step creation, see the problem

      Now "x64" is selected as platform. Remove the file "test.h" from the project by selecting the file in the solution explorer and press delete.
      The header file and also the corresponding MOC result files (Debug\moc_test.cpp + Release\moc_test.cpp) will be removed.
      Now readd the header file via right click on the project in the solution exporer and select "Add->Existing Item..." from the popup. Select the header file and accept with OK.
      The header file is added again and also the MOC files. There is one MOC file for Debug configuration and one MOC file for Release configuration. Depending wheter you choose Debug or Release as configuration for "x64" platform you can see that one of the MOC files is excluded from build.
      This is the desired behaviour because not both of the files should be compiled and linked for one configuration.
      If you switch to "Win32" as platform you can see that both MOC files are excluded from build. This is wrong. This should behave as in the "x64" platform.
      One can manually fix this in the moc_test.cpp properties. "Excluded From Build" must be set to "No" according the configuration in "x64". The bug is that the Add-in does not configure this by itself in the first place.

      Attachments

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

        Activity

          People

            ishaataj Ismo Haataja
            mawiesma Martin Wiesmann (closed Nokia identity) (Inactive)
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes