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

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • None
    • 2.4.3
    • Build-time integration
    • None
    • 2.4.3 Rev 7, Visual Studio 2019, Qt 5.12.3
    • 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

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

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes