Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Error unknown type name 'QStringRef'; did you mean 'CFStringRef'? #21901

Closed
Kalanamith opened this issue May 10, 2021 · 7 comments
Closed

Comments

@Kalanamith
Copy link

Getting the following error when building

/usr/local/Cellar/qt@5/5.15.2/lib/QtCore.framework/Headers/qlocale.h:1033:25: error: 
      unknown type name 'QStringRef'; did you mean 'CFStringRef'?
    ulong toULong(const QStringRef &s, bool *ok = nullptr) const;
                        ^~~~~~~~~~
                        CFStringRef
/usr/local/include/QtCore/qdebug.h:473:1: note: 'CFStringRef' declared here
Q_FORWARD_DECLARE_CF_TYPE(CFString);

@fanquake
Copy link
Member

Do you have qt 5 and 6 installed via brew? If so, you will need to uninstall qt6 before configuring / compiling.

1 similar comment
@fanquake
Copy link
Member

Do you have qt 5 and 6 installed via brew? If so, you will need to uninstall qt6 before configuring / compiling.

@Kalanamith
Copy link
Author

Yep install qt5 as per installation guide

@fanquake
Copy link
Member

Not much more we can do here without more info. Can you provide a config.log or similar? Which version of the source are you building? etc. Will reopen when we've got more info.

@gcsfred2
Copy link

I have the same error. Is there an alternative that is not downgrading qt?

@hebasto
Copy link
Member

hebasto commented Jan 13, 2022

@gcsfred2

Not much more we can do here without more info. Can you provide a config.log or similar? Which version of the source are you building? etc. Will reopen when we've got more info.

@da2ce7
Copy link

da2ce7 commented Aug 28, 2022

Hello @hebasto and @fanquake

I get the same qt compiler error:

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

@bitcoin bitcoin locked and limited conversation to collaborators Aug 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants
@da2ce7 @fanquake @Kalanamith @hebasto @gcsfred2 and others