1

I'm looking to use the GetBoolArg() function in the interpreter.cpp file what changes do I have to make for it to work?

I'm still new to development c, I tried several #include but without success.

Thank you in advance.

4
  • You've tried #include <common/args.h> ? May 27 at 17:19
  • @MichaelFolksonYes despite the fact that it is declared in this file it did not work.
    – Retro_pex
    May 27 at 17:41
  • You're recompiling after you've made the change? May 27 at 17:48
  • @MichaelFolkson Yes, I get the following error: error: use of undeclared identifier 'GetBoolArg'
    – Retro_pex
    May 27 at 18:12

1 Answer 1

3

interpreter.cpp is part of the internal libbitcoin_consensus library, while GetBoolArg() is in common/args.{h/cpp} which is part of the internal libbitcoin_common library. The Makefile specifies a linking order that has libbitcoin_common depend on libbitcoin_consensus. In order for implementation to work, you would have to modify the Makefile and shuffle things around so that libbitcoin_consensus could depend on libbitcoin_common without any circular dependencies.

However this is an indicator that your implementation probably has a layer violation. Things in libbitcoin_consensus should not need access to things in libbitcoin_common, Rather you should add or modify one of the data passing classes to hold the value for the parameter that you want passed, and that class will be filled by callers located somewhere that already depends on both libbitcoin_common and libbitcoin_consensus.

1
  • I see thank you for the answer, I will try to modify my code accordingly.
    – Retro_pex
    May 27 at 19:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.