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. Compilation error on Q_DISABLE_COPY_MOVE
Forum Updated to NodeBB v4.3 + New Features

Compilation error on Q_DISABLE_COPY_MOVE

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 1.7k 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.
  • Joel BodenmannJ Offline
    Joel BodenmannJ Offline
    Joel Bodenmann
    wrote on last edited by
    #1

    Disclaimer: I'm the author of the QSchematic library.

    I'm using this library successfully on various platforms such as Windows, Linux & FreeBSD. Today I wanted to play around with GitHub actions as that seems to be free for open source projects.
    When the CI system compiles on Ubuntu, I am getting this error pretty much every time a Q_DISABLE_COPY_MOVE shows up:

    /home/runner/work/QSchematic/QSchematic/build/qschematic/qschematic-objs_autogen/HU7TA6T7T7/../../../../qschematic/items/item.h:25:9: error: ISO C++ forbids declaration of ‘Q_DISABLE_COPY_MOVE’ with no type [-fpermissive]
       25 |         Q_DISABLE_COPY_MOVE(Item)
          |         ^~~~~~~~~~~~~~~~~~~
    

    You can see the full build log here: https://github.com/simulton/QSchematic/runs/4381051342?check_suite_focus=true

    Now, if I fire up an Ubuntu 21.04 or 21.10 VM I am able to build the library without any problems.

    I'm having troubles understanding what's going wrong here. Does anybody have any useful insights?

    Industrial process automation software: https://simulton.com
    Embedded Graphics & GUI library: https://ugfx.io

    jsulmJ 1 Reply Last reply
    0
    • Joel BodenmannJ Joel Bodenmann

      Disclaimer: I'm the author of the QSchematic library.

      I'm using this library successfully on various platforms such as Windows, Linux & FreeBSD. Today I wanted to play around with GitHub actions as that seems to be free for open source projects.
      When the CI system compiles on Ubuntu, I am getting this error pretty much every time a Q_DISABLE_COPY_MOVE shows up:

      /home/runner/work/QSchematic/QSchematic/build/qschematic/qschematic-objs_autogen/HU7TA6T7T7/../../../../qschematic/items/item.h:25:9: error: ISO C++ forbids declaration of ‘Q_DISABLE_COPY_MOVE’ with no type [-fpermissive]
         25 |         Q_DISABLE_COPY_MOVE(Item)
            |         ^~~~~~~~~~~~~~~~~~~
      

      You can see the full build log here: https://github.com/simulton/QSchematic/runs/4381051342?check_suite_focus=true

      Now, if I fire up an Ubuntu 21.04 or 21.10 VM I am able to build the library without any problems.

      I'm having troubles understanding what's going wrong here. Does anybody have any useful insights?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Joel-Bodenmann Is Qt version >= 5.13?
      Is Item known type in that scope?
      Is QObject included directly or indirectly?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      Joel BodenmannJ 1 Reply Last reply
      2
      • jsulmJ jsulm

        @Joel-Bodenmann Is Qt version >= 5.13?
        Is Item known type in that scope?
        Is QObject included directly or indirectly?

        Joel BodenmannJ Offline
        Joel BodenmannJ Offline
        Joel Bodenmann
        wrote on last edited by
        #3

        @jsulm Thank you for your reply.

        Is Qt version >= 5.13?

        I checked the GitHub Actions documentation and it would appear that ubuntu-latest is Ubuntu 20.04.
        As far as I can tell, Ubuntu 20.04 ships with Qt 5.12.8.

        I take it that I need to modify the code to work with Qt 5.12 then. Would you be able to point me towards the aspect(s) relevant to this situation?

        Is Item known type in that scope?

        Yep.

        Is QObject included directly or indirectly?

        Indirectly.

        Industrial process automation software: https://simulton.com
        Embedded Graphics & GUI library: https://ugfx.io

        jsulmJ 1 Reply Last reply
        0
        • Joel BodenmannJ Joel Bodenmann

          @jsulm Thank you for your reply.

          Is Qt version >= 5.13?

          I checked the GitHub Actions documentation and it would appear that ubuntu-latest is Ubuntu 20.04.
          As far as I can tell, Ubuntu 20.04 ships with Qt 5.12.8.

          I take it that I need to modify the code to work with Qt 5.12 then. Would you be able to point me towards the aspect(s) relevant to this situation?

          Is Item known type in that scope?

          Yep.

          Is QObject included directly or indirectly?

          Indirectly.

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Joel-Bodenmann said in Compilation error on Q_DISABLE_COPY_MOVE:

          Would you be able to point me towards the aspect(s) relevant to this situation?

          You can disable copy/move by yourself: make copy and move constructors private. Somewhat more code to write, but independent of Qt and its version.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • Joel BodenmannJ Offline
            Joel BodenmannJ Offline
            Joel Bodenmann
            wrote on last edited by
            #5

            Alright - I checked the docs and Q_DISABLE_COPY_MOVE exists only since Qt 5.13 which leads to this problem.

            Thank you for your help!

            Industrial process automation software: https://simulton.com
            Embedded Graphics & GUI library: https://ugfx.io

            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