2

So I am on the docs for building bitcoind for OS X: https://github.com/bitcoin/bitcoin/blob/master/doc/build-osx.md and I've had the same error every time I try and build. Here are the steps I take:

brew install autoconf automake berkeley-db4 libtool boost miniupnpc openssl pkg-config protobuf qt5

git clone https://github.com/bitcoin/bitcoin.git
cd bitcoin

./autogen.sh
./configure --with-gui=qt5
make

and here is the error I get:

OBJCXXLD qt/bitcoin-qt
clang: error: unknown argument: '-framework QtNetwork'
clang: error: unknown argument: '-framework QtWidgets'
clang: error: unknown argument: '-framework QtGui'
clang: error: unknown argument: '-framework QtCore'
clang: error: unknown argument: '-framework QtDBus'
clang: error: unknown argument: '-framework QtCore'
make[2]: *** [qt/bitcoin-qt] Error 1
make[1]: *** [check-recursive] Error 1
make: *** [check-recursive] Error 1

I have googled for over a day now. I've manually downloaded the open source Qt here: http://www.qt.io/download-open-source/, I have qt and qt5 installed via brew, etc. I'm not that familiar with C/C++ and compiling code and have no idea what to try next. Thanks in advance

rgngl
  • 5,353
  • 3
  • 30
  • 34
JimmyMow
  • 83
  • 2
  • 8

4 Answers4

1

First of all try building a non-GUI bitcoind:

make clean
./configure --without-gui
make
cassini
  • 44
  • 1
0

I had the same error... I fixed this by manually editing the MakeFile

The problem is in the QT_DBUS_LIBS, QT_LIBS and QT_TEST_LIBS definitions below... the -F flag and -framework is the one causing the problem.

QT_DBUS_LIBS = -F/usr/local/Cellar/qt5/5.5.0/lib -framework\ QtDBus -F/usr/local/Cellar/qt5/5.5.0/lib -framework\ QtCore 
QT_LIBS = -F/usr/local/Cellar/qt5/5.5.0/lib/QtNetwork -F/usr/local/Cellar/qt5/5.5.0/lib -framework\ QtWidgets -F/usr/local/Cellar/qt5/5.5.0/lib -framework\ QtGui -F/usr/local/Cellar/qt5/5.5.0/lib -framework\ QtCore  -framework Foundation -framework ApplicationServices -framework AppKit
QT_TEST_LIBS = -F/usr/local/Cellar/qt5/5.5.0/lib -framework\ QtTest -F/usr/local/Cellar/qt5/5.5.0/lib -framework\ QtCore 

Replace these library names with direct references to the library... you have to first find your Qt library path, mine was at /usr/local/Cellar/qt5/5.5.0/lib

QT_DBUS_LIBS = /usr/local/Cellar/qt5/5.5.0/lib/QtDBus.framework/QtDBus /usr/local/Cellar/qt5/5.5.0/lib/QtCore.framework/QtCore
QT_LIBS = /usr/local/Cellar/qt5/5.5.0/lib/QtNetwork.framework/QtNetwork /usr/local/Cellar/qt5/5.5.0/lib/QtWidgets.framework/QtWidgets /usr/local/Cellar/qt5/5.5.0/lib/QtGui.framework/QtGui /usr/local/Cellar/qt5/5.5.0/lib/QtCore.framework/QtCore  -framework Foundation -framework ApplicationServices -framework AppKit
QT_TEST_LIBS = /usr/local/Cellar/qt5/5.5.0/lib/QtTest.framework/QtTest /usr/local/Cellar/qt5/5.5.0/lib/QtCore.framework/QtCore

after the changes do

make clean
make

Works great!

Run the bitcoin-qt which is the GUI version of bitcoin core from the src\qt directory

Have fun! Please remember if you run configure again these changes will be overwritten.

randv
  • 9
  • 3
-1

I passed this error by making changes(need to be redone after each ./configure) to Makefile and src/Makefile by

1: Taking off the several '-framework Qtxxxx's, since they are kind of redundant with the '-F path/to/qt/' in same line.

2: Replacing the rest '-framework's to some basic Apple libraries with '-F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks'

But after all, I still gave up on qt gui because I then hit exact problem as in below link, which seems the qt5 from homebrew is not for x64, and I'm too lazy to follow the hack here

https://github.com/bitcoin/bitcoin/issues/5728

user917099
  • 231
  • 3
  • 11
-1

I had the same problem and solved it by switching back to qt4 and compiling without GUI:

brew install autoconf automake berkeley-db4 libtool boost miniupnpc openssl pkg-config protobuf qt4

git clone https://github.com/bitcoin/bitcoin.git
cd bitcoin

./autogen.sh
./configure
make
behas
  • 3,386
  • 5
  • 27
  • 27