discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Are there firls and kaiser filter methods for C++ OOT?


From: Marcin Puchlik
Subject: Re: Are there firls and kaiser filter methods for C++ OOT?
Date: Tue, 22 Feb 2022 13:32:07 +0100

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 <vvvelichkov@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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]