Hi Vasil,
But I am not creating the OOT module, I want to get filter taps using
*low_pass()*  function in simple C++ program (Hello World).
I just want to link gnuradio library and use its function in custom C++
program, here is the code of main.cpp:

#include <iostream>
#include <gnuradio/math.h>
#include <gnuradio/filter/firdes.h>
#include <gnuradio/fft/window.h>

using namespace std;

int main() {
cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
std::vector<float> taps = gr::filter::firdes::low_pass(1, 1, 0.3, 0.1);
return 0;
}

I even ran this from cmd with the command: *g++
-I/usr/include/gnuradio/filter -L/usr/lib/x86_64-linux-gnu/ main.cpp *
and the error is:



*/bin/ld: /tmp/ccTlKCri.o: in function `main':main.cpp:(.text+0xc7):
undefined reference to `gr::filter::firdes::low_pass_2(double, double,
double, double, double, gr::fft::window::win_type, double)'collect2: error:
ld returned 1 exit status*



wt., 22 lut 2022 o 13:22 Vasil Velichkov <vvvelich...@gmail.com> napisaƂ(a):

> Hi Marcin,
>
> On 22/02/2022 13.09, Marcin Puchlik via GNU Radio, the Free & Open-Source
> Toolkit for Software Radio wrote:
> > I also tried to use *low_pass() *function in my C++ program but with no
> > luck. My linker shouts that there is undefined reference to this function
> > but headers where recognized.
>
> You need to link your OOT module to gnuradio-filter library - in
> lib/CMakeLists.txt in target_link_libraries() add gnuradio-filter.
>
>     target_link_libraries(gnuradio-test gnuradio::gnuradio-runtime
> gnuradio-filter)
>
> Regards,
> Vasil
>
  • Are there... George Edwards
    • Re: ... GNU Radio, the Free & Open-Source Toolkit for Software Radio
      • ... George Edwards
      • ... George Edwards
        • ... GNU Radio, the Free & Open-Source Toolkit for Software Radio
          • ... Vasil Velichkov
            • ... GNU Radio, the Free & Open-Source Toolkit for Software Radio
              • ... Vasil Velichkov
                • ... GNU Radio, the Free & Open-Source Toolkit for Software Radio
                • ... Vasil Velichkov
                • ... GNU Radio, the Free & Open-Source Toolkit for Software Radio
                • ... Vasil Velichkov
                • ... GNU Radio, the Free & Open-Source Toolkit for Software Radio
        • ... Vasil Velichkov
          • ... George Edwards
            • ... GNU Radio, the Free & Open-Source Toolkit for Software Radio
              • ... George Edwards

Reply via email to