Forum: GNU Radio Problem trying to implement Reed Solomon encoder

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Alvaro P. (Guest)
on 2008-11-21 17:48
(Received via mailing list)

I'm trying to create a GNU Radio block that carries out a Reed Solomon
coding based on the functions provided into the
directory /gnuradio-core/src/lib/reed-solomon.

As an example I have taken the block gr_encode_ccsds_27 that can be
found in the directory /gnuradio-core/src/lib/general since it uses the
functions implemented in /gnuradio-core/src/lib/viterbi.

Basically the aspect of my file is the following:

#include "config.h"

#include <gr_rs_encoder_vbb.h>
#include <gr_io_signature.h>

extern "C" {
#include "../reed-solomon/fixed.h"

  return gr_rs_encoder_vbb_sptr(new gr_rs_encoder_vbb());

  : gr_sync_block("rs_encoder_vbb",
                         gr_make_io_signature(1, 1, (223)*sizeof(char)),
                         gr_make_io_signature(1, 1, 255*sizeof(char)))


gr_rs_encoder_vbb::work(int noutput_items,
                            gr_vector_const_void_star &input_items,
                            gr_vector_void_star &output_items)
  const unsigned char *in = (const unsigned char *)input_items[0];
  unsigned char *out = (unsigned char *)output_items[0];

  for (int i = 0; i < noutput_items; i++)
    unsigned char *temp_first_element = out;
    for (int j = 0; j < (223); j++)
        *out++ = *in++;

  return noutput_items;

I include the file fixed.h since I want to use the implementation of the
CCSDS standard (255,223).

When I execute make into the main folder of GNU Radio for compiling
everything I get the following ERROR message:

/bin/bash ../../../libtool --tag=CXX   --mode=link g++ -g -O2 -Wall
-Woverloaded-virtual -pthread   -o benchmark_dotprod_fff
libtool: link: g++ -g -O2 -Wall -Woverloaded-virtual -pthread
-o .libs/benchmark_dotprod_fff
-lrt /usr/lib/ -lm -pthread
undefined reference to `encode_rs_8'
collect2: ld returned 1 exit status
make[4]: *** [benchmark_dotprod_fff] Error 1
make[4]: Leaving directory
make[3]: *** [all-recursive] Error 1

It looks like I'm missing to include another file somewhere, but I have
no idea where.

Have anybody tried to implement this yet or anybody knows how I could
fix it?

Thank you very much.

Best regards.

Alvaro P. (Guest)
on 2008-11-21 22:30
(Received via mailing list)

Your problem is because you are not *linking* with the Reed/Solomon

The problem is that you've wrapped the '#include <fixed.h>' inside an
'extern "C"' block.

If you remove it then you'll be one step closer to getting it working.

Is mise,

Alvaro P. (Guest)
on 2008-11-24 18:29
(Received via mailing list)
Hi Stevie,

thank you very much for the advice. I have tried to compile it removing
the extern C wrap but it is not working, it keep on displaying the same
error message.

Maybe I'm wrong, but since all the files in the directory
lib/reed-solomon are written in C instead of C++, isn't the wrap "extern
C" necessary in my C++ component code?

Thanks again.

This topic is locked and can not be replied to.