Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Warning: No relevant classes found. No output generated.
Forum Updated to NodeBB v4.3 + New Features

Warning: No relevant classes found. No output generated.

Scheduled Pinned Locked Moved General and Desktop
8 Posts 3 Posters 16.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Asperamanca
    wrote on last edited by
    #1

    I work on an application that runs both on a desktop PC and an embedded device. A few classes of the application are only relevant for the desktop version, but overall, I use the same code base and the same .pro file (with a couple of switches to distinguish between platforms, of course).

    In order to hide a class that's not needed on the embedded device, I completely enclose it (both declarations in the header and definitions within the cpp file) with
    @#ifndef Q_WS_QWS
    ...
    #endif // Q_WS_QWS@

    When compiling for the embedded device, I get the warning:

    bq. Warning: No relevant classes found. No output generated.

    Yes, the message is correct. I know, and this is how it should be. How do I turn it off?

    PS:
    I found a few forum entries suggestion I remove such files from the HEADERS section of the .pro file. It strikes me as strange, because after all, the .pro file must contain all source files that need to be compiled.

    PPS:
    ...and I certainly don't want to maintain two separate .pro files for desktop and embedded.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      You can use conditionals in your .pro files as well.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Asperamanca
        wrote on last edited by
        #3

        Is the Q_WS_QWS-define already set by the time the .pro file is parsed?

        1 Reply Last reply
        0
        • L Offline
          L Offline
          lgeyer
          wrote on last edited by
          #4

          No, but qmake understands various other scopes. Take a look at the qmake documentation or just take a look at "Qt itself":http://qt.gitorious.org/qt/qtbase/blobs/master/src/corelib/kernel/kernel.pri#line42 where scopes are used a lot.

          1 Reply Last reply
          0
          • A Offline
            A Offline
            Asperamanca
            wrote on last edited by
            #5

            The issue I have with those scopes is that they are very poorly documented, if at all. For example, I have seen an "embedded" scope used in Qt's .pro files. Is it comparable to Q_WS_QWS? Will it be set in all the cases where Q_WS_QWS is set?

            My code relies that the class exists if
            @#ifndef Q_WS_QWS@

            using a qmake-level scope that does anything but provide the exact same behavior sounds like asking for trouble.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andre
              wrote on last edited by
              #6

              Well, using scopes is what Qt itself uses. You'll have to for Q_OBJECTS that are different for desktop and embedded, as moc itself does not understand precompiler directives.

              1 Reply Last reply
              0
              • L Offline
                L Offline
                lgeyer
                wrote on last edited by
                #7

                qmake documentation definitly would need some love. The thing with scopes is that there are a lot of things which can be used as a scope condition, including various compiler- and platform-specific options - compiling and maintaining such a list would be quite a task.

                A short summary recited from mind, which should cover almost all usual possibilities and use cases:

                • win32, macx, unix
                • everything from $QTDIR/mkspecs, for example linux-g++ or qws
                • everything listed in CONFIG, for example shared or debug

                Also keep in mind that scopes allow for negation and nesting, fo example !win32.

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  Asperamanca
                  wrote on last edited by
                  #8

                  Thanks! Your short list is a better documentation than anything I have found so far.

                  "qws" sounds promising, maybe this is exactly what I need.

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved