almindor / etherwall

Ethereum QT5 Wallet
GNU General Public License v3.0
142 stars 59 forks source link

compilation errors in Ubuntu 20.04 #127

Open mcmillco opened 3 years ago

mcmillco commented 3 years ago

Thanks for this project, it looks very interesting! I am having some troubles compiling on Ubuntu 20.04, though. I believe I have all the dependencies listed, but it feels like something is missing. I have the same issues on both the master and v2 branches.

$ make
g++ -c -pipe -O2 -pthread -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_WEBSOCKETS_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -Isrc -Isrc/ew-node/src -isystem /usr/include/hidapi -isystem /usr/include/libusb-1.0 -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtQuick -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtQml -isystem /usr/include/x86_64-linux-gnu/qt5/QtWebSockets -isystem /usr/include/x86_64-linux-gnu/qt5/QtNetwork -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o main.o src/main.cpp
In file included from src/accountmodel.h:33,
                 from src/main.cpp:36:
src/ew-node/src/nodeipc.h:211:9: error: ‘QElapsedTimer’ does not name a type; did you mean ‘QBasicTimer’?
  211 |         QElapsedTimer fKillTime;
      |         ^~~~~~~~~~~~~
      |         QBasicTimer
make: *** [Makefile:891: main.o] Error 1

If I go to src/ew-node/src/nodeipc.h and add the line #include <QElapsedTimer>, it passes that step but then crashes with the error:

g++ -c -pipe -O2 -pthread -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_WEBSOCKETS_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -Isrc -Isrc/ew-node/src -isystem /usr/include/hidapi -isystem /usr/include/libusb-1.0 -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtQuick -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtQml -isystem /usr/include/x86_64-linux-gnu/qt5/QtWebSockets -isystem /usr/include/x86_64-linux-gnu/qt5/QtNetwork -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o nodeipc.o src/ew-node/src/nodeipc.cpp
src/ew-node/src/nodeipc.cpp: In constructor ‘Etherwall::NodeIPC::NodeIPC(Etherwall::GethLog&)’:
src/ew-node/src/nodeipc.cpp:106:42: error: ‘errorOccurred’ is not a member of ‘QLocalSocket’
  106 |         connect(&fSocket, &QLocalSocket::errorOccurred, this, &NodeIPC::onSocketError);
      |                                          ^~~~~~~~~~~~~
src/ew-node/src/nodeipc.cpp: In member function ‘virtual const QStringList Etherwall::NodeIPC::buildGethArgs()’:
src/ew-node/src/nodeipc.cpp:730:81: error: ‘SkipEmptyParts’ is not a member of ‘Qt’
  730 |             args = (argStr + " --datadir " + ddStr + "/rinkeby").split(' ', Qt::SkipEmptyParts);
      |                                                                                 ^~~~~~~~~~~~~~
src/ew-node/src/nodeipc.cpp:733:68: error: ‘SkipEmptyParts’ is not a member of ‘Qt’
  733 |             args = (argStr + " --datadir " + ddStr).split(' ', Qt::SkipEmptyParts);
      |                                                                    ^~~~~~~~~~~~~~
make: *** [Makefile:1109: nodeipc.o] Error 1

Thank you!

almindor commented 3 years ago

This seems like some sort of QT5 version issue. I wonder if the ubuntu Qt5 setup is somehow different. What's the qt5base package version you have?

mcmillco commented 3 years ago

I was thinking in that direction too. It seems like something is subtly different in Qt. I have 5.12 (the Ubuntu default packages), which is why I tried the v2 branch -- the master branch says it wants 5.15+, while the v2 branch says 5.6+. But I get the same behavior in both branches.

$ apt-cache policy libqt5core5a
libqt5core5a:
  Installed: 5.12.8+dfsg-0ubuntu1
  Candidate: 5.12.8+dfsg-0ubuntu1
  Version table:
 *** 5.12.8+dfsg-0ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages
        100 /var/lib/dpkg/status
$ qmake --version
QMake version 3.1
Using Qt version 5.12.8 in /usr/lib/x86_64-linux-gnu
almindor commented 3 years ago

I'll try and set up a VM to test this sometime next week.

kaoh commented 2 years ago

An updates? I see the same behavior on Ubuntu 20.04.

TheOnePerson commented 2 years ago

I had the same issue on Ubuntu 20.04. It appears that Qt version 5.12, which comes with Ubuntu 20.04 is too old for proper compiling. My solution was to download Qt 5.15.2 sources (from here: https://download.qt.io/official_releases/qt/5.15/5.15.2/single/ ), and compile it from scratch. With Qt 5.15.x Etherwallet compiles just fine.