Pulsar-Coin / Pulsar-Coin-Cryptocurrency

The source code to the Pulsar Coin Blockchain
https://pulsarcoin.info/
MIT License
17 stars 11 forks source link

Fix errors by adding #includes to different files of source code #26

Closed younicoin closed 6 months ago

younicoin commented 6 months ago

Hello, PulsarCoin developers. I use Devuan Linux, gcc version 12.2.0 (Debian 12.2.0-14), libqt5gui5/stable,now 5.15.8+dfsg-11 amd64, and I had errors, could not build. I fixed errors by adding some includes to different files of source code. And finally built. Could you check and accept my pull request after that? Here 'v' is alias of 'vim', 'makek' is alias of 'make' with time stamps, 'mk' is also alias of 'make' with timestamps. I hope this log will help to someone to fix errors on other blockchains, I often see these errors with deque and bosst/bind, and minotaurx while compile blockchain networks.

##2024-03-26 16:54 install PLSR pulsarcoin 1.1.6
wget https://github.com/Pulsar-Coin/Pulsar-Coin-Cryptocurrency/archive/refs/tags/v1.1.6.tar.gz
tar -xf v1.1.6.tar.gz
cd Pulsar-Coin-Cryptocurrency-1.1.6/
  ##https://github.com/Pulsar-Coin/Pulsar-Coin-Cryptocurrency/blob/main/doc/build-unix.md
./autogen.sh
./configure --with-incompatible-bdb
d=`date`; make; date; echo start date was $d
  httpserver.cpp:74:10: error: ‘deque’ in namespace ‘std’ does not name a template type
     74 |     std::deque<std::unique_ptr<WorkItem>> queue;
        |      
v src/httpserver.cpp
  41:#include <deque>
alias makek='d=`date`; make; date; echo start date was $d'
makek
  validation.cpp:2257:94: error: ‘_1’ was not declared in this scope
   2257 |         pool.NotifyEntryRemoved.connect(boost::bind(&ConnectTrace::NotifyEntryRemoved, this, _1, _2));
v src/validation.cpp
  53:#include <boost/bind/bind.hpp>
  #include <boost/signals2/signal.hpp>
  using namespace boost::placeholders;
makek
  validationinterface.cpp:89:112: error: ‘_1’ was not declared in this scope
     89 |     g_signals.m_internals->BlockChecked.disconnect(boost::bind(&CValidationInterface::BlockChecked, pwalletIn, _1, _2));
v src/validationinterface.cpp
  22:#include <boost/bind/bind.hpp>
  #include <boost/signals2/signal.hpp>
  using namespace boost::placeholders;
makek
  In file included from crypto/minotaurx/blake2s-ref.c:18:
  crypto/minotaurx/blake2.h:101:5: error: size of array element is not a multiple of its alignment
    101 |     blake2s_state S[8][1];
v src/crypto/minotaurx/blake2.h
  100://typedef struct __blake2sp_state
  typedef struct ALIGNME( 64 ) __blake2sp_state
  109:  //typedef struct __blake2bp_state
  typedef struct ALIGNME( 64 ) __blake2bp_state
makek
  In file included from crypto/minotaurx/blake2s-ref.c:18:
  crypto/minotaurx/blake2.h:100:27: error: expected identifier or ‘(’ before numeric constant
    100 |   typedef struct ALIGNME( 64 ) __blake2sp_state
v src/crypto/minotaurx/blake2.h
  100:-typedef struct ALIGNME( 64 ) __blake2sp_state
  +typedef struct ALIGN( 64 ) __blake2sp_state
  109:-typedef struct ALIGNME( 64 ) __blake2bp_state
  +typedef struct ALIGN( 64 ) __blake2bp_state
makek
  In file included from crypto/minotaurx/blake2s-ref.c:18:
  crypto/minotaurx/blake2.h:102:5: error: size of array element is not a multiple of its alignment
    102 |     blake2s_state S[8][1];
v src/crypto/minotaurx/blake2.h
  102:-typedef struct ALIGN( 64 ) __blake2sp_state
  +ALIGN( 64 ) typedef struct __blake2sp_state
makek
  crypto/minotaurx/blake2.h:102:5: error: size of array element is not a multiple of its alignment
    102 |     blake2s_state S[8][1];
v src/crypto/minotaurx/blake2.h
  89://ALIGN( 64 ) typedef struct __blake2b_state
  typedef struct ALIGN( 64 ) __blake2b_state
  101:typedef struct ALIGN( 64 ) __blake2sp_state
  110:typedef struct ALIGN( 64 ) __blake2bp_state
makek
  #now go further
  qt/bitcoingui.cpp:1247:86: error: ‘_1’ was not declared in this scope
   1247 |     uiInterface.ThreadSafeMessageBox.connect(boost::bind(ThreadSafeMessageBox, this, _1, _2, _3));
v src/qt/bitcoingui.cpp
  68:#include <boost/bind/bind.hpp>
  #include <boost/signals2/signal.hpp>
  using namespace boost::placeholders;
makek
  qt/clientmodel.cpp:336:70: error: ‘_1’ was not declared in this scope
    336 |     uiInterface.ShowProgress.connect(boost::bind(ShowProgress, this, _1, _2));
v src/qt/clientmodel.cpp
  31:#include <boost/bind/bind.hpp>
  #include <boost/signals2/signal.hpp>
  using namespace boost::placeholders;
makek
  qt/splashscreen.cpp:215:77: error: ‘_2’ was not declared in this scope
    215 |     uiInterface.ShowProgress.disconnect(boost::bind(ShowProgress, this, _1, _2, _3));
v src/qt/splashscreen.cpp
  29:#include <boost/bind/bind.hpp>
  #include <boost/signals2/signal.hpp>
  using namespace boost::placeholders;
makek
  qt/trafficgraphwidget.cpp: In member function ‘void TrafficGraphWidget::paintPath(QPainterPath&, QQueue<float>&)’:
  qt/trafficgraphwidget.cpp:54:9: error: invalid use of incomplete type ‘class QPainterPath’
     54 |         path.moveTo(x, YMARGIN + h);
v src/qt/trafficgraphwidget.cpp
  14:#include <QPainterPath>
makek
  qt/transactiontablemodel.cpp:783:90: error: ‘_1’ was not declared in this scope
    783 |     wallet->NotifyTransactionChanged.connect(boost::bind(NotifyTransactionChanged, this, _1, _2, _3));
v src/qt/transactiontablemodel.cpp
  29:#include <boost/bind/bind.hpp>
  #include <boost/signals2/signal.hpp>
  using namespace boost::placeholders;
alias mk='d=`date`; make; date; echo start date was $d'
mk
  qt/walletmodel.cpp:514:105: error: ‘_4’ was not declared in this scope
    514 |     wallet->NotifyAddressBookChanged.disconnect(boost::bind(NotifyAddressBookChanged, this, _1, _2, _3, _4, _5, _6));
v src/qt/walletmodel.cpp
  36:#include <boost/bind/bind.hpp>
  #include <boost/signals2/signal.hpp>
  using namespace boost::placeholders;
mk
  Tue Mar 26 05:33:26 PM MSK 2024
  start date was Tue Mar 26 05:31:51 PM MSK 2024
./src/qt/pulsar-qt
  #works fine

  #2024-03-26 17:36 now fork PLSR and fix code
mkdir my-fix
cd my-fix
git clone git@github.com:younicoin/Pulsar-Coin-Cryptocurrency.git
cd Pulsar-Coin-Cryptocurrency/
v src/httpserver.cpp
  41:#include <deque>
v src/validation.cpp
  53:#include <boost/bind/bind.hpp>
  #include <boost/signals2/signal.hpp>
  using namespace boost::placeholders;
v src/validationinterface.cpp
  22:#include <boost/bind/bind.hpp>
  #include <boost/signals2/signal.hpp>
  using namespace boost::placeholders;
v src/crypto/minotaurx/blake2.h
  64://ALIGN( 64 ) typedef struct __blake2s_state
  typedef struct ALIGN( 64 ) __blake2s_state
  91://ALIGN( 64 ) typedef struct __blake2b_state
  typedef struct ALIGN( 64 ) __blake2b_state
  101://typedef struct __blake2sp_state
  typedef struct ALIGN( 64 ) __blake2sp_state
  110://typedef struct __blake2bp_state
  typedef struct ALIGN( 64 ) __blake2bp_state
v src/qt/bitcoingui.cpp
  68:#include <boost/bind/bind.hpp>
  #include <boost/signals2/signal.hpp>
  using namespace boost::placeholders;
v src/qt/clientmodel.cpp
  31:#include <boost/bind/bind.hpp>
  #include <boost/signals2/signal.hpp>
  using namespace boost::placeholders;
v src/qt/splashscreen.cpp
  29:#include <boost/bind/bind.hpp>
  #include <boost/signals2/signal.hpp>
  using namespace boost::placeholders;
v src/qt/trafficgraphwidget.cpp
  14:#include <QPainterPath>
v src/qt/transactiontablemodel.cpp
  29:#include <boost/bind/bind.hpp>
  #include <boost/signals2/signal.hpp>
  using namespace boost::placeholders;
v src/qt/walletmodel.cpp
  36:#include <boost/bind/bind.hpp>
  #include <boost/signals2/signal.hpp>
  using namespace boost::placeholders;
v src/qt/bitcoin.cpp
  571://QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);

  #now check my-fix
cd ../../
cp -r my-fix my-build
cd my-build/
cd Pulsar-Coin-Cryptocurrency/
./autogen.sh 
./configure --with-incompatible-bdb
mk
  copying selected object files to avoid basename conflicts...
  Tue Mar 26 05:56:09 PM MSK 2024
  start date was Tue Mar 26 05:47:26 PM MSK 2024
  #so 11 minutes
./src/qt/pulsar-qt
  #works
  Attribute Qt::AA_EnableHighDpiScaling must be set before QCoreApplication is created.
v src/qt/bitcoin.cpp
  570:#if QT_VERSION >= 0x050600
    //QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
  #endif
mk
./src/qt/pulsar-qt