[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] can't compile C++ example
From: |
Tom Rondeau |
Subject: |
Re: [Discuss-gnuradio] can't compile C++ example |
Date: |
Tue, 14 May 2013 17:50:47 +0100 |
On Tue, May 14, 2013 at 2:08 PM, Gong Zhang <address@hidden> wrote:
> Hi,
> I wanna execute the dial_tone.cc example.So I execute "g++ dial_tone.cc
> -I /usr/local/include/gnuradio/"
> But I got the errors:
> laptop:~/Desktop/ccompile$ g++ dial_tone.cc -I /usr/local/include/gnuradio/
> /tmp/ccxAFik0.o: In function `main':
> dial_tone.cc:(.text+0x59): undefined reference to
> `gr_make_top_block(std::basic_string<char, std::char_traits<char>,
> std::allocator<char> > const&)'
> dial_tone.cc:(.text+0xc2): undefined reference to
> `gr_make_sig_source_f(double, gr_waveform_t, double, double, float)'
> dial_tone.cc:(.text+0xfb): undefined reference to
> `gr_make_sig_source_f(double, gr_waveform_t, double, double, float)'
> dial_tone.cc:(.text+0x176): undefined reference to `audio_make_sink(int,
> std::basic_string<char, std::char_traits<char>, std::allocator<char> >,
> bool)'
> dial_tone.cc:(.text+0x238): undefined reference to
> `gr_hier_block2::connect(boost::shared_ptr<gr_basic_block>, int,
> boost::shared_ptr<gr_basic_block>, int)'
> dial_tone.cc:(.text+0x2de): undefined reference to
> `gr_hier_block2::connect(boost::shared_ptr<gr_basic_block>, int,
> boost::shared_ptr<gr_basic_block>, int)'
> dial_tone.cc:(.text+0x33d): undefined reference to `gr_top_block::run(int)'
> collect2: ld returned 1 exit status
You should able to just build it running 'make' in the build
directory, not have to use your own g++ command line. Cmake should set
up the Makefile for the correct includes, linkings, flags, etc. It
should just be built when you built the rest of GNU Radio, anyways.
Tom