Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. About Shadow Build in Qt Creator
Forum Updated to NodeBB v4.3 + New Features

About Shadow Build in Qt Creator

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
4 Posts 4 Posters 1.9k 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.
  • Swati777999S Offline
    Swati777999S Offline
    Swati777999
    wrote on last edited by kshegunov
    #1

    What does shadow build in Qt Creator signify?

    Sometimes when a compilation error related to missing files occurs even when files are not missing,I uncheck shadow build, then my program seems to compile successfully.

    [Moved to Tools ~kshegunov]

    “ In order to be irreplaceable, one must always be different” – Coco Chanel

    kshegunovK J.HilkJ 2 Replies Last reply
    0
    • Swati777999S Swati777999

      What does shadow build in Qt Creator signify?

      Sometimes when a compilation error related to missing files occurs even when files are not missing,I uncheck shadow build, then my program seems to compile successfully.

      [Moved to Tools ~kshegunov]

      kshegunovK Offline
      kshegunovK Offline
      kshegunov
      Moderators
      wrote on last edited by
      #2

      @Swati777999 said in About Shadow Build in Qt Creator:

      What does shadow build in Qt Creator signify?

      Not specific to creator. A "shadow build" is the preferred way in most configurations, that is when the build is put in a separate directory, which isn't part of the source tree.

      Sometimes when a compilation error related to missing files occurs even when files are not missing,I uncheck shadow build, then my program seems to compile successfully.

      Then probably you simply need(ed) to rerun qmake/cmake.

      Read and abide by the Qt Code of Conduct

      1 Reply Last reply
      2
      • Swati777999S Swati777999

        What does shadow build in Qt Creator signify?

        Sometimes when a compilation error related to missing files occurs even when files are not missing,I uncheck shadow build, then my program seems to compile successfully.

        [Moved to Tools ~kshegunov]

        J.HilkJ Offline
        J.HilkJ Offline
        J.Hilk
        Moderators
        wrote on last edited by
        #3

        @Swati777999
        The Qt tool chain, similar to others, has a bunch of code generating tools that are run during a compilation. Above all the Meta-Object Compiler (MOC). If you don't shadow build, all those files will clutter your source directory.

        And being the smart as tools that they are, they will not regenerate files, that already exist, if "nothing changed"

        The problem now, is that detection is not 100 % reliable, especially if you switch between debug/release builds and/or compilers
        Something similar happened in your described situation.

        The go to tool is a clean rebuild, aka rerunning qmake/cmake or simply deleting the shadow build folder.

        don't uncheck the shadow build checkbox, you'll invite problems later down the line, if you have to change it select an other path/directory to shadow build in, it will have the same effect.


        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


        Q: What's that?
        A: It's blue light.
        Q: What does it do?
        A: It turns blue.

        B 1 Reply Last reply
        2
        • J.HilkJ J.Hilk

          @Swati777999
          The Qt tool chain, similar to others, has a bunch of code generating tools that are run during a compilation. Above all the Meta-Object Compiler (MOC). If you don't shadow build, all those files will clutter your source directory.

          And being the smart as tools that they are, they will not regenerate files, that already exist, if "nothing changed"

          The problem now, is that detection is not 100 % reliable, especially if you switch between debug/release builds and/or compilers
          Something similar happened in your described situation.

          The go to tool is a clean rebuild, aka rerunning qmake/cmake or simply deleting the shadow build folder.

          don't uncheck the shadow build checkbox, you'll invite problems later down the line, if you have to change it select an other path/directory to shadow build in, it will have the same effect.

          B Offline
          B Offline
          beeka
          wrote on last edited by
          #4

          @J-Hilk said in About Shadow Build in Qt Creator:

          @Swati777999
          The Qt tool chain, similar to others, has a bunch of code generating tools that are run during a compilation. Above all the Meta-Object Compiler (MOC). If you don't shadow build, all those files will clutter your source directory.

          I am often helping people debug issues with mixing shadow / in-place builds. Building using a shadow /tmp is faster, so they decide to switch to that but then complain that changes to their forms / .ui files are not working. The uic is generating a new header file for their updated form but the c++ preprocessor finds the old one from the non-shadow build (i.e. without their changes). Unchecking shadow build will then result in builds updating the in-place files, so having the build 'work'. Like @J-Hilk said, make sure you have no Qt-generated files in your source directory when using shadow builds and don't switch between shadow / in-place without being very careful about old generated files.

          Steve.

          1 Reply Last reply
          1

          • Login

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