# AttributeError: 'module' object has no attribute 'block\_name'

**URL:** <https://www.ruby-forum.com/t/attributeerror-module-object-has-no-attribute-block-name/233027>\
**Category:** GNU Radio\
**Created:** [November 12, 2014, 9:25am UTC](https://www.ruby-forum.com/t/attributeerror-module-object-has-no-attribute-block-name/233027 "2014-11-12T09:25:44Z")\
**Posts on this page:** 2\
**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:** [November 12, 2014, 9:25am UTC](https://www.ruby-forum.com/t/attributeerror-module-object-has-no-attribute-block-name/233027/1 "2014-11-12T09:25:44Z")

</div>

Hello all,

I’ve just created a block called “sliding\_fft”. The \_impl.h file looks  
like:

#include \<gnuradio/fft/fft.h\>

namespace gr {  
namespace lte\_dl\_rx {

```
class sliding_fft_impl : public sliding_fft
{
 private:
    fft::fft_complex *d_fft;
    uint d_fft_size;
    uint count;

 public:
  sliding_fft_impl(uint fft_size);
  ~sliding_fft_impl();

  // Where all the action really happens
  int work(int noutput_items,
   gr_vector_const_void_star &input_items,
   gr_vector_void_star &output_items);
};

```

} // namespace lte\_dl\_rx  
} // namespace gr

and the \_impl.cc looks like:

/\*

```
 * The private constructor

 */

sliding_fft_impl::sliding_fft_impl(uint fft_size)

  : gr::sync_block("sliding_fft",

          gr::io_signature::make(1, 1, sizeof(gr_complex)),

          gr::io_signature::make(1, 1, 

```

fft\_size\*sizeof(gr\_complex))),

```
    d_fft_size(fft_size),

    count(1)

{

    d_fft = new fft::fft_complex (fft_size, 1, 1);

    set_history(fft_size);

}

```

There is no attribute problem till I don’t use the “d\_fft = new  
fft::fft\_complex (fft\_size, 1, 1);” line in the constructor!

After working a lot, I got the attribute error in grc is due to this  
line!

Please help me why this is happening ?

Thank you kindly,

Mostafa

---

<div class="post-metadata">

**Author:** ![mostafa\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/5e9695/32.png) [@mostafa\_a](https://www.ruby-forum.com/u/mostafa_a)\
**Post date:** [December 10, 2014, 7:56am UTC](https://www.ruby-forum.com/t/attributeerror-module-object-has-no-attribute-block-name/233027/2 "2014-12-10T07:56:34Z")

</div>

Hi all,

Even I am getting the same problem with that line in a different  
scenario. What is going wrong here?

Thanks,  
Joseph
