MacOS Build Error: Qt 5 and 6 Simultaneously Installed. #25947

issue da2ce7 opened this issue on August 28, 2022
  1. da2ce7 commented at 10:08 PM on August 28, 2022: none

    This error seems to appear when brew install qt@5 is installed at the same time as: brew install qt. (ie, qt version 6):

    % brew list --version | grep qt
    
    qt 6.3.1_1
    qt@5 5.15.5_1
    
    Making all in src
      CXX      qt/libbitcoinqt_a-bantablemodel.o
    In file included from qt/bantablemodel.cpp:14:
    In file included from /usr/local/Cellar/qt@5/5.15.5_1/lib/QtCore.framework/Headers/QLocale:1:
    /usr/local/Cellar/qt@5/5.15.5_1/lib/QtCore.framework/Headers/qlocale.h:1028:25: error: unknown type name 'QStringRef'; did you mean 'CFStringRef'?
        short toShort(const QStringRef &s, bool *ok = nullptr) const;
                            ^~~~~~~~~~
                            CFStringRef
    /usr/local/include/QtCore/qdebug.h:531:1: note: 'CFStringRef' declared here
    Q_FORWARD_DECLARE_CF_TYPE(CFString);
    ^
    /usr/local/include/QtCore/qglobal.h:802:77: note: expanded from macro 'Q_FORWARD_DECLARE_CF_TYPE'
    #  define Q_FORWARD_DECLARE_CF_TYPE(type) typedef const struct __ ## type * type ## Ref
                                                                                ^
    <scratch space>:112:1: note: expanded from here
    CFStringRef
    ^
    
    % git clean -ffxd
    % git rev-parse HEAD
    e191fac4f3c37820f0618f72f0a8e8b524531ab8
    % ./autogen.sh
    % ./configure
    % make
    

    output: https://gist.github.com/da2ce7/c697259e204c961876ad7f7057e95b34

    config.log: https://gist.github.com/da2ce7/ec7276de7d0284681cd73b0cdcb90f3b

    brew list --version --formulae: https://gist.github.com/da2ce7/25d6473224a1d69a28cf24e44abb55b7

    Originally posted by @da2ce7 in #21901 (comment)

  2. hebasto commented at 10:30 PM on August 28, 2022: member

    @da2ce7

    This error seems to appear when brew install qt@5 is installed at the same time as: brew install qt.

    This is unsupported configuration. See: https://github.com/bitcoin/bitcoin/blob/master/doc/build-osx.md#qt

    Could be fixed after #25797.

  3. hebasto closed this on Aug 28, 2022

  4. da2ce7 referenced this in commit 94d1505dbe on Aug 29, 2022
  5. luke-jr commented at 1:24 AM on September 9, 2022: member

    This should be reopened. Unrelated packages shouldn't break things.

  6. hebasto reopened this on Sep 9, 2022

  7. hebasto added the label macOS on Sep 9, 2022
  8. hebasto added the label Build system on Sep 9, 2022
  9. fanquake commented at 10:25 AM on September 9, 2022: member

    There's more to this than just qt5 and qt6 being installed via brew. I've tested building on a macOS (M1) system, with both installed, and there are no compilation problems.

  10. hebasto commented at 6:45 PM on September 9, 2022: member

    I was going to fix this issue, and already had a draft of the patch, but...

    macOS Monterey 12.6 (21G115, Intel):

    % brew list --version | grep qt
    qt 6.3.1_3
    qt@5 5.15.5_2
    

    ~Having the same result as @fanquake:~

    ~there are no compilation problems.~

    ~Definitely, I observed problems in the past, but not now.~

    ~So, @da2ce7 and other devs, who observe such an issue, please provide more details about your systems to let us to reproduce it. Also try to update brew's packages.~

    EDIT: The build above was configured with --enable-suppress-external-warnings. Without this option I do observe the issue.

  11. hebasto commented at 9:55 PM on September 9, 2022: member

    A fix suggested in #26056 (comment).

  12. fanquake closed this on Sep 14, 2022

  13. fanquake referenced this in commit c67d6f5b5f on Sep 14, 2022
  14. sidhujag referenced this in commit f9a8249fff on Sep 14, 2022
  15. bitcoin locked this on Sep 14, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-02 18:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me