bitcoin-abc icon indicating copy to clipboard operation
bitcoin-abc copied to clipboard

Fix errors during building on Linux 6.1.0-18, g++ 12.2.0-14

Open younicoin opened this issue 1 year ago • 1 comments

While compiled on Linux, fixed some mistakes in code: included libraries, commented out a QT dpi settings. I built without compiling depends, because I have installed those few dependencies. My system:

~$ g++ --version
g++ (Debian 12.2.0-14) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

~$ gcc --version
gcc (Debian 12.2.0-14) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

~$ uname -a
Linux devuan 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 GNU/Linux
~$ apt list --installed 2>&1 | grep boost
libboost-all-dev/stable,now 1.74.0.3 amd64 [installed]

Here it is full process log of first compilation and compilation of my own repository with fixes

wget https://github.com/freecashorg/freecash/archive/refs/tags/v1.0.5.tar.gz
tar -xf v1.0.5.tar.gz 
cd freecash-1.0.5/
#https://github.com/freecashorg/freecash/blob/master/doc/build-unix.md
head -1 depends/packages/packages.mk 
  packages:=boost openssl libevent zeromq
./autogen.sh
mkdir build
cd build
../configure --with-incompatible-bdb
make
  ../../src/amount.h:28:15: note: because ‘Amount’ has user-provided ‘constexpr Amount::Amount(const Amount&)’
     28 |     constexpr Amount(const Amount &_camount) : amount(_camount.amount) {}
        |               ^~~~~~
    CXX      libfreecash_server_a-httpserver.o
  ../../src/httpserver.cpp:77:10: error: ‘deque’ in namespace ‘std’ does not name a template type
     77 |     std::deque<std::unique_ptr<WorkItem>> queue;
vim ../src/httpserver.cpp
  42:#include <deque>
make
  ../../src/validation.cpp: In constructor ‘ConnectTrace::ConnectTrace(CTxMemPool&)’:
  ../../src/validation.cpp:2260:66: error: ‘_1’ was not declared in this scope
   2260 |             boost::bind(&ConnectTrace::NotifyEntryRemoved, this, _1, _2));
vim ../src/validation.cpp
  57:#include <boost/bind/bind.hpp>
  #include <boost/signals2/signal.hpp>
  using namespace boost::placeholders;
make
  ../../src/validationinterface.cpp:85:67: error: ‘_2’ was not declared in this scope
     85 |         boost::bind(&CMainSignals::MempoolEntryRemoved, this, _1, _2));
vim ../src/validationinterface.cpp
  22:#include <boost/bind/bind.hpp>
  #include <boost/signals2/signal.hpp>
  using namespace boost::placeholders;
  make
  ../../src/qt/bitcoingui.cpp: In member function ‘void BitcoinGUI::subscribeToCoreSignals()’:
  ../../src/qt/bitcoingui.cpp:1255:49: error: ‘_1’ was not declared in this scope
   1255 |         boost::bind(ThreadSafeMessageBox, this, _1, _2, _3));
vim ../src/qt/bitcoingui.cpp
  62:#include <boost/bind/bind.hpp>
  #include <boost/signals2/signal.hpp>
  using namespace boost::placeholders;
make
  ../../src/qt/clientmodel.cpp: In member function ‘void ClientModel::subscribeToCoreSignals()’:
  ../../src/qt/clientmodel.cpp:240:67: error: ‘_1’ was not declared in this scope
    240 |         m_node.handleShowProgress(boost::bind(ShowProgress, this, _1, _2));
vim ../src/qt/clientmodel.cpp
  30:#include <boost/bind/bind.hpp>
  #include <boost/signals2/signal.hpp>
  using namespace boost::placeholders;
make
  ../../src/qt/splashscreen.cpp:178:45: error: ‘_2’ was not declared in this scope
    178 |         boost::bind(ShowProgress, this, _1, _2, false)));
vim ../src/qt/splashscreen.cpp
  28:#include <boost/bind/bind.hpp>
  #include <boost/signals2/signal.hpp>
  using namespace boost::placeholders;
make
  ../../src/qt/trafficgraphwidget.cpp: In member function ‘void TrafficGraphWidget::paintPath(QPainterPath&, QQueue<float>&)’:
  ../../src/qt/trafficgraphwidget.cpp:45:9: error: invalid use of incomplete type ‘class QPainterPath’
     45 |         path.moveTo(x, YMARGIN + h);
vim ../src/qt/trafficgraphwidget.h
  11:#include <QPainterPath>
make
  ../../src/qt/transactiontablemodel.cpp: In member function ‘void TransactionTableModel::subscribeToCoreSignals()’:
  ../../src/qt/transactiontablemodel.cpp:771:57: error: ‘_1’ was not declared in this scope
    771 |             boost::bind(NotifyTransactionChanged, this, _1, _2));
vim ../src/qt/transactiontablemodel.cpp
  29:#include <boost/bind/bind.hpp>
  #include <boost/signals2/signal.hpp>
  using namespace boost::placeholders;
make
  ../../src/qt/walletmodel.cpp: In member function ‘void WalletModel::subscribeToCoreSignals()’:
  ../../src/qt/walletmodel.cpp:395:53: error: ‘_1’ was not declared in this scope
    395 |         boost::bind(NotifyAddressBookChanged, this, _1, _2, _3, _4, _5));
vim ../src/qt/walletmodel.cpp
  27:#include <boost/bind/bind.hpp>
  #include <boost/signals2/signal.hpp>
  using namespace boost::placeholders;
make
    CXX      script/libbitcoinconsensus_la-script.lo
    CXX      script/libbitcoinconsensus_la-script_error.lo
    CXX      script/libbitcoinconsensus_la-sigencoding.lo
    CXX      libbitcoinconsensus_la-uint256.lo
    CXX      libbitcoinconsensus_la-utilstrencodings.lo
    CXXLD    libbitcoinconsensus.la
  make[2]: Leaving directory '/mnt/disk-evo-500/crypto/testing/fch/freecash-1.0.5/build/src'
  make[1]: Leaving directory '/mnt/disk-evo-500/crypto/testing/fch/freecash-1.0.5/build/src'
  Making all in doc/man
  make[1]: Entering directory '/mnt/disk-evo-500/crypto/testing/fch/freecash-1.0.5/build/doc/man'
  make[1]: Nothing to be done for 'all'.
  make[1]: Leaving directory '/mnt/disk-evo-500/crypto/testing/fch/freecash-1.0.5/build/doc/man'
  make[1]: Entering directory '/mnt/disk-evo-500/crypto/testing/fch/freecash-1.0.5/build'
  make[1]: Nothing to be done for 'all-am'.
  make[1]: Leaving directory '/mnt/disk-evo-500/crypto/testing/fch/freecash-1.0.5/build'
./src/qt/freecash-qt
  ##2024-02-22 15:19 works, but with warning in terminal:
  Attribute Qt::AA_EnableHighDpiScaling must be set before QCoreApplication is created.
  ##same issue as in litecoincash
vim src/qt/bitcoin.cpp
  648://QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
cd build
../configure --with-incompatible-bdb
make
./src/qt/freecash-qt
  #works without warnings

Here it is compilation of my repository with fixes (and without any error):

  ##2024-02-22 15:59 now push fix
mkdir my-fix
cd my-fix/
git clone [email protected]:younicoin/freecash.git
cd freecash/
vim src/httpserver.cpp
  42:#include <deque>

vim src/validation.cpp
  57:#include <boost/bind/bind.hpp>
  #include <boost/signals2/signal.hpp>
  using namespace boost::placeholders;

vim src/validationinterface.cpp
  22:#include <boost/bind/bind.hpp>
  #include <boost/signals2/signal.hpp>
  using namespace boost::placeholders;
vim src/qt/bitcoingui.cpp
  62:#include <boost/bind/bind.hpp>
  #include <boost/signals2/signal.hpp>
  using namespace boost::placeholders;

vim src/qt/clientmodel.cpp
  30:#include <boost/bind/bind.hpp>
  #include <boost/signals2/signal.hpp>
  using namespace boost::placeholders;
vim src/qt/splashscreen.cpp
  28:#include <boost/bind/bind.hpp>
  #include <boost/signals2/signal.hpp>
  using namespace boost::placeholders;
vim src/qt/trafficgraphwidget.h
  11:#include <QPainterPath>
vim src/qt/transactiontablemodel.cpp
  29:#include <boost/bind/bind.hpp>
  #include <boost/signals2/signal.hpp>
  using namespace boost::placeholders;
vim src/qt/walletmodel.cpp
  27:#include <boost/bind/bind.hpp>
  #include <boost/signals2/signal.hpp>
  using namespace boost::placeholders;
vim src/qt/bitcoin.cpp
  648://QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
cd ..
cp -r freecash/ compile-freecash
cd compile-freecash
./autogen.sh
mkdir build && cd build
../configure --with-incompatible-bdb
make
  ##16:06:39 started to make. finished at Thu Feb 22 04:37:24 PM MSK 2024
./src/qt/freecash-qt
  ##works fine

younicoin avatar Feb 22 '24 13:02 younicoin

I can have a look at that last commit, but please note that this Github repository is just a mirror of reviews.bitcoinabc.org. See CONTRIBUTING.md

It is likely that the boost includes you added are no longer needed in the current codebase (a lot of boost dependencies were removed in the last 3 years since your fork).

PiRK avatar Mar 11 '24 20:03 PiRK