discuss-gnuradio
[Top][All Lists]
Advanced

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

[Discuss-gnuradio] Can not use howto with c++


From: zzw.1012
Subject: [Discuss-gnuradio] Can not use howto with c++
Date: Tue, 8 Jun 2010 16:56:14 +0800 (CST)

Hi,
    Now, I find a good method to make use of gnuradio blocks with c++ and without python. I get it from http://gnuradio.org/redmine/repositories/browse/gnuradio/gnuradio-examples/c++/dial_tone.
    So , after install gr-howto-write-a-block successfully, I want to test the block with c++ as the example of dial_tone.
But , I run into a stone wall.  here is my code:
#include <iostream>
#include <vector>
#include <gr_top_block.h>
#include <gr_io_signature.h>
#include <gr_vector_source_f.h>
#include <gr_vector_sink_f.h>
#include <howto_square_ff.h>
int main()
{
        std::vector<float> data_source;
        float f[5] = {-3, 4, -5.5, 2, 3};
        for (int i = 0; i < 5; i++)
        {
                data_source.push_back(f[i]);
        }
        gr_top_block_sptr tb = gr_make_top_block("topblock");
        gr_vector_source_f_sptr src = "" 5);
        howto_square_ff_sptr howto_square = howto_make_square_ff();
        gr_vector_sink_f_sptr dst = gr_make_vector_sink_f(5);
        tb->connect(src,0, howto_square,0);
        tb->connect(howto_square, 0, dst,0);
        tb->run();
        return 0;
}
I have add the _howto.so 's path.  "-L....../gr-howto-write-a-block-3.2.2/src/lib/.libs" and "-l_howto"
when I start "make", then it turn up linker error as followed:
/usr/bin/ld:  cannot find -l_howto
collect2: ld returned 1 exit status
make: *** [howto] error 1
after compare with gnuradio-core's libgnuradio-core.so format, I copy the _howto.so to the path .../gr/lib and rename it as libhowto.so and use "-lhowto"
then, I "make" again, then it turn up linker error as followed:
/work/project/keywie_11p/gr/lib//libhowto.so: undefined reference to `PyTuple_SetItem'
/work/project/keywie_11p/gr/lib//libhowto.so: undefined reference to `PyExc_ValueError'
/work/project/keywie_11p/gr/lib//libhowto.so: undefined reference to `PyLong_AsLong'
/work/project/keywie_11p/gr/lib//libhowto.so: undefined reference to `_PyInstance_Lookup'
/work/project/keywie_11p/gr/lib//libhowto.so: undefined reference to `PyObject_GetAttr'
/work/project/keywie_11p/gr/lib//libhowto.so: undefined reference to `PyObject_Call'
/work/project/keywie_11p/gr/lib//libhowto.so: undefined reference to `PyExc_IndexError'
.....

what's wrong with this case? The howto block could not use directly in c++ as  gr_sig_source_f or audio_alsa_make_sink, isn't it ? Or, I have made a mistake ?

thanks
best wishes!
 

 
 



网易为中小企业免费提供企业邮箱(自主域名)

reply via email to

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