Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Can't Build QT on Monterey: qiosurfacegraphicsbuffer.h:54:32: error: unknown type name 'CGColorSpaceRef'; did you mean 'QColorSpace'?

Can't Build QT on Monterey: qiosurfacegraphicsbuffer.h:54:32: error: unknown type name 'CGColorSpaceRef'; did you mean 'QColorSpace'?

Scheduled Pinned Locked Moved Solved Installation and Deployment
macosqt5.15.2build qt
8 Posts 4 Posters 2.6k Views
  • 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.
  • C Offline
    C Offline
    ChiK
    wrote on last edited by
    #1

    I'm on MacOS 12.2.1 with QT 5.15.2.
    I get these errors when I try to build QT.
    qiosurfacegraphicsbuffer.h:54:32: error: unknown type name 'CGColorSpaceRef'; did you mean 'QColorSpace'?
    qiosurfacegraphicsbuffer.mm:90:32: error: out-of-line definition of 'setColorSpace' does not match any declaration in 'QIOSurfaceGraphicsBuffer'
    Here's the complete output.
    https://pastebin.com/raw/R9zdmdN9
    I'd appreciate any help!
    Thanks!

    C 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Which version of Xcode are you using ?
      With which SDK ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      C 2 Replies Last reply
      0
      • SGaistS SGaist

        Hi,

        Which version of Xcode are you using ?
        With which SDK ?

        C Offline
        C Offline
        ChiK
        wrote on last edited by
        #3

        @SGaist Thanks for your reply. I'm using xcode 13.2.1.
        How do I find out which sdk I'm using?

        1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          Which version of Xcode are you using ?
          With which SDK ?

          C Offline
          C Offline
          ChiK
          wrote on last edited by
          #4

          @SGaist said in Can't Build QT on Monterey: qiosurfacegraphicsbuffer.h:54:32: error: unknown type name 'CGColorSpaceRef'; did you mean 'QColorSpace'?:

          which SDK

          xcrun -sdk macosx --show-sdk-path
          It says MacOSX12.1.sdk

          1 Reply Last reply
          0
          • E Offline
            E Offline
            erikmiers
            wrote on last edited by
            #5

            Hi, had the same issue.
            This helped me:
            https://codereview.qt-project.org/c/qt/qtbase/+/378706
            Also following this:
            https://wiki.qt.io/Building_Qt_5_from_Git
            And exclude qtwebengine from the build, this does not work with 5.15.2 anymore.

            Best Regards.
            Erik

            C 1 Reply Last reply
            1
            • E erikmiers

              Hi, had the same issue.
              This helped me:
              https://codereview.qt-project.org/c/qt/qtbase/+/378706
              Also following this:
              https://wiki.qt.io/Building_Qt_5_from_Git
              And exclude qtwebengine from the build, this does not work with 5.15.2 anymore.

              Best Regards.
              Erik

              C Offline
              C Offline
              ChiK
              wrote on last edited by
              #6

              @erikmiers how do apply that patch? I did exclude webengine when building.

              1 Reply Last reply
              0
              • C ChiK

                I'm on MacOS 12.2.1 with QT 5.15.2.
                I get these errors when I try to build QT.
                qiosurfacegraphicsbuffer.h:54:32: error: unknown type name 'CGColorSpaceRef'; did you mean 'QColorSpace'?
                qiosurfacegraphicsbuffer.mm:90:32: error: out-of-line definition of 'setColorSpace' does not match any declaration in 'QIOSurfaceGraphicsBuffer'
                Here's the complete output.
                https://pastebin.com/raw/R9zdmdN9
                I'd appreciate any help!
                Thanks!

                C Offline
                C Offline
                ChiK
                wrote on last edited by
                #7

                v6.3.0-beta2 builds without an error on Monterey 12.2.1 Xcode 13.2.1.

                1 Reply Last reply
                0
                • J Offline
                  J Offline
                  John Johnson
                  wrote on last edited by
                  #8

                  Qt6 is a whole new library. There's no way I'm going to try to build a Qt5 app with it. There's a 0% chance it would build. So I went through the trouble of figuring out how to apply those patches.

                  The link above is to a confusing web tool, but I eventually figured out that you can download the patches. Both of them are identical, so only one is needed. But the patch can't be applied to Qt5 automatically, so you'll have to manually edit the file.

                  If you downloaded the "qt-everywhere-src-5.15.2" archive, the file to patch is:

                  qtbase/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h

                  Somewhere before the line that says QT_BEGIN_NAMESPACE, insert this line:

                  #include <CoreGraphics/CGColorSpace.h>

                  Then configure without qtwebengine:

                  ./configure -opensource -confirm-license -skip qtwebengine && make -j 8

                  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