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

moc is not seeing defines from the project file

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P1: Critical
    • Resolution: Unresolved
    • Affects Version/s: 2.4.3
    • Fix Version/s: None
    • Component/s: Qt/MSBuild
    • Labels:
      None
    • Environment:
      2.4.3 Rev 7, Visual Studio 2019, Qt 5.12.3
    • Platform/s:
      Windows

      Description

      Testing Rev 7 linked from QTVSADDINBUG-704

       

      Ran into this error compiling qputty, but it boils down to the attached example. Moc think the slot exists even though it is removed with a define.

      build output for the attached example:

      1>------ Build started: Project: test, Configuration: Debug Win32 ------
      1>Generate moc_predefs.h
      1>Moc'ing test.h...
      1>test.cpp
      1>C:\Users\Noah\source\repos\bugtest\test.cpp(16,26): warning C4100: 'argv': unreferenced formal parameter
      1>C:\Users\Noah\source\repos\bugtest\test.cpp(16,14): warning C4100: 'argc': unreferenced formal parameter
      1>moc_test.cpp
      1>C:\Users\Noah\source\repos\bugtest\Debug\moc_test.cpp(75,30): error C2039: 'testSlot2': is not a member of 'TestObject'
      1>C:\Users\Noah\source\repos\bugtest\test.h(3): message : see declaration of 'TestObject'
      1>Done building project "test.vcxproj" – FAILED.
      ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

       

        Attachments

        1. test.cpp
          0.3 kB
        2. test.h
          0.2 kB
        3. test.pro
          0.1 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            mecfc Miguel Costa
            Reporter:
            noah Noah Hamerslough
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes