Error while compiling bitcoin with qt support #7138

issue wilsonwang371 opened this issue on December 1, 2015
  1. wilsonwang371 commented at 12:01 AM on December 1, 2015: none

    The error details are:

    In file included from qt/clientmodel.cpp:5:0:
    qt/clientmodel.h: In function ‘void BlockTipChanged(ClientModel*, bool, const CBlockIndex*)’:
    qt/clientmodel.h:92:10: error: ‘void ClientModel::numBlocksChanged(int, const QDateTime&, double)’ is protected
         void numBlocksChanged(int count, const QDateTime& blockDate, double nVerificationProgress);
              ^
    qt/clientmodel.cpp:256:154: error: within this context
             Q_EMIT clientmodel->numBlocksChanged(pIndex->nHeight, QDateTime::fromTime_t(pIndex->GetBlockTime()), clientmodel->getVerificationProgress(pIndex));
                                                                                                                                                          ^
    

    It looks like a static function is trying to call a private method of ClientModel. There are two ways to fix this problem:

    1. Declare numBlocksChanged as a friend of class ClientModel.
    2. Add another public method to call line 256 instead of putting it in a static method outside class.

    I tried two approaches and both of them work. Which one is better?

    Btw, I am new here. I am trying to join bitcoin community and hope I can make more contributions.

  2. jonasschnelli commented at 4:49 AM on December 1, 2015: contributor

    Thanks for reporting. This was introduced with: #7112

    Methods 1) would be preferred I guess.

  3. jonasschnelli added the label Bug on Dec 1, 2015
  4. jonasschnelli added the label GUI on Dec 1, 2015
  5. jonasschnelli removed the label Bug on Dec 1, 2015
  6. laanwj added this to the milestone 0.12.0 on Dec 1, 2015
  7. laanwj commented at 8:53 AM on December 1, 2015: member

    Strange, why did none of our testing / Travis builds reveal this?

    Edit: OK, seems this only comes up for qt4.

  8. laanwj referenced this in commit edf337d7fc on Dec 1, 2015
  9. laanwj commented at 10:49 AM on December 1, 2015: member

    See #7143

  10. laanwj referenced this in commit 6da12dff28 on Dec 1, 2015
  11. laanwj closed this on Dec 1, 2015

  12. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 18:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me