<p><code>interpreter.cpp</code> is part of the internal <code>libbitcoin_consensus</code> library, while <code>GetBoolArg()</code> is in <code>common/args.{h/cpp}</code> which is part of the internal <code>libbitcoin_common</code> library. The <code>Makefile</code> specifies a linking order that has <code>libbitcoin_common</code> depend on <code>libbitcoin_consensus</code>. In order for implementation to work, you would have to modify the <code>Makefile</code> and shuffle things around so that <code>libbitcoin_consensus</code> could depend on <code>libbitcoin_common</code> without any circular dependencies.</p>
<p>However this is an indicator that your implementation probably has a layer violation. Things in <code>libbitcoin_consensus</code> should not need access to things in <code>libbitcoin_common</code>, 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 <code>libbitcoin_common</code> and <code>libbitcoin_consensus</code>.</p>

CC BY-SA 4.0
2023-05-27T19:23:12.500Z
I see thank you for the answer, I will try to modify my code accordingly.
Retro_pex
CC BY-SA 4.0
2023-05-27T18:05:38.200Z
2023-05-27T18:05:38.200Z
Ava Chow
<p>I'm looking to use the GetBoolArg() function in the interpreter.cpp file what changes do I have to make for it to work?</p>
<p>I'm still new to development c, I tried several #include but without success.</p>
<p>Thank you in advance.</p>

CC BY-SA 4.0
2023-05-27T17:19:08.193Z
You've tried `#include <common/args.h>` ?
Michael Folkson
CC BY-SA 4.0
2023-05-27T17:41:37.793Z
@MichaelFolksonYes despite the fact that it is declared in this file it did not work.
Retro_pex
CC BY-SA 4.0
2023-05-27T17:48:19.207Z
You're recompiling after you've made the change?
Michael Folkson
CC BY-SA 4.0
2023-05-27T18:12:03.277Z
@MichaelFolkson Yes, I get the following error: `error: use of undeclared identifier 'GetBoolArg'`
Retro_pex
<bitcoin-core-development><compiling><c++>
Is it possible to use the getboolarg function in interpreter.cpp
Retro_pex
# Is it possible to use the getboolarg function in interpreter.cpp

(Asked by: username_0 on 2023-05-27)

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.

**Tags:** bitcoin-core-development, compiling, c++

> **Comments:**
> **username_1**: You've tried `#include <common/args.h>` ?  
> **username_0**: @MichaelFolksonYes despite the fact that it is declared in this file it did not work.  
> **username_1**: You're recompiling after you've made the change?  
> **username_0**: @username_1 Yes, I get the following error: `error: use of undeclared identifier 'GetBoolArg'`  

---

## 1 answers

### Answer by username_2 on 2023-05-27. Score: 3 | Accepted answer

`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`.

> **Comments:**
> **username_0**: I see thank you for the answer, I will try to modify my code accordingly.  

---

