# How to use other modules in my out-of-tree module?

**URL:** <https://www.ruby-forum.com/t/how-to-use-other-modules-in-my-out-of-tree-module/234667>\
**Category:** GNU Radio\
**Created:** [March 20, 2015, 9:09am UTC](https://www.ruby-forum.com/t/how-to-use-other-modules-in-my-out-of-tree-module/234667 "2015-03-20T09:09:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [March 20, 2015, 9:09am UTC](https://www.ruby-forum.com/t/how-to-use-other-modules-in-my-out-of-tree-module/234667/1 "2015-03-20T09:09:21Z")

</div>

In my out-of-tree module (in develop)

I want to use Reed-Solomon encoder and decoder from [gr-dvbt](https://github.com/BogdanDIA/gr-dvbt)

I’ve successfully installed gr-dvbt.

In my code, it contains:

```
#include <dvbt/reed_solomon_enc.h>
#include <dvbt/reed_solomon_dec.h>
#include <dvbt/reed_solomon.h>

```

and variable declaration:

```
reed_solomon::reed_solomon d_rs(rs_p, rs_m, gfpoly, phy.rs_n, 

```

phy.rs\_k,  
phy.rs\_t2 / 2, phy.rs\_s, blocks);

and so on.

When I build my module with `make` command, the following errors appear:

```
gr-mymodule/lib/utils.cc: In function ‘void outer_encode(char*, 

```

char\*,  
tx\_param&, phy\_param&)’:  
gr-mymodule/lib/utils.cc:170:3: error: ‘reed\_solomon’ has not been  
declared  
reed\_solomon::reed\_solomon d\_rs(rs\_p, rs\_m, gfpoly, phy.rs\_n,  
phy.rs\_k, phy.rs\_t2 / 2, phy.rs\_s, blocks); // gr-dvbt  
^

I think I need to modify CMakeLists.txt in somewhere and somehow to tell  
‘I  
will be using gr-dvbt’, but I have no idea to do it.

Does anyone have an idea for my problem?

Regards,  
Jeon.

---

<div class="post-metadata">

**Author:** ![Jeon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e8c25b/32.png) [@Jeon](https://www.ruby-forum.com/u/Jeon)\
**Post date:** [March 20, 2015, 2:39pm UTC](https://www.ruby-forum.com/t/how-to-use-other-modules-in-my-out-of-tree-module/234667/2 "2015-03-20T14:39:00Z")

</div>

On Fri, Mar 20, 2015 at 4:07 AM, Jeon [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> ```
> #include <dvbt/reed_solomon_dec.h>
> 
> ```
> 
> Does anyone have an idea for my problem?
> 
> Regards,  
> Jeon.

I haven’t tested this, just looked at the code, so not sure this is the  
full answer. You’re using reed\_solomon as the namespace, which it’s not;  
it’s the class name under the dvbt namespace. Try calling it like:

dvbt::reed\_solomon d\_rs(…)

You will have to link against the dvbt library in the CMakeLists.txt  
file  
(in the lib/ directory), but this is a compiler error, not a linker  
error.

Tom

---

<div class="post-metadata">

**Author:** ![Jeon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e8c25b/32.png) [@Jeon](https://www.ruby-forum.com/u/Jeon)\
**Post date:** [March 23, 2015, 2:48pm UTC](https://www.ruby-forum.com/t/how-to-use-other-modules-in-my-out-of-tree-module/234667/3 "2015-03-23T14:48:53Z")

</div>

Thanks, TOm.

Answer to my question.

gr::dvbt::reed\_solomon d\_rs(…) works.

No CMakeLists modification and other stuffs are needed.

Regards,  
Jeon.

2015-03-20 22:36 GMT+09:00 Tom R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):
