Hi there,
I'm coding a program in C++ whose purpose is data logging,
in it i'm using GNU radio libraries. In addition, i'm
declaring gr hierarchical blocks in the code as they have a
connect function that simplifies the complexity of the
program.
I'm using Visual studio IDE with visual C compiler to run the
program and as i do i get various errors which i have been
trying to figure out for days. I've googled similar errors and
asked in stackoverflow but i've had no luck.
Ill include some of the lines of errors i'm getting as well as
some lines of code(the program is small) to make this email as
clear as possible. In the attachment i included a txt file
that contains the full code and errors.
---------ERRORS ------------
1>c:\program files (x86)\microsoft visual
studio\2017\community\vc\tools\msvc\14.10.25017\include\xlocnum(64):
error C2039: 'pow': is not a member of '`global namespace''
1>c:\program files (x86)\microsoft visual
studio\2017\community\vc\tools\msvc\14.10.25017\include\xlocnum(64):
error C3861: 'pow': identifier not found
1>c:\program files (x86)\microsoft visual
studio\2017\community\vc\tools\msvc\14.10.25017\include\xlocnum(81):
error C2039: 'powf': is not a member of '`global namespace''
1>c:\program files (x86)\microsoft visual
studio\2017\community\vc\tools\msvc\14.10.25017\include\xlocnum(81):
error C3861: 'powf': identifier not found
1>c:\program files (x86)\microsoft visual
studio\2017\community\vc\tools\msvc\14.10.25017\include\complex(256):
error C2039: 'atan2l': is not a member of '`global namespace''
1>c:\program files (x86)\microsoft visual
studio\2017\community\vc\tools\msvc\14.10.25017\include\complex(256):
error C3861: 'atan2l': identifier not found
------CODE------
int UHD_SAFE_MAIN(int argc, char *argv[])
{
uhd::stream_args_t stream_args("fc32", "sc16");
std::string device_args("serial=30DCE9E");
std::string subdev("A:A A:B");
std::string ant("RX2");
std::string ref("default");
double rate(5e6);
double freq(130e6);
double gain(0);
double bw(1e6);
gr::top_block_sptr tb = gr::make_top_block("fcd_nfm_rx"); //
Construct a top block that will contain flowgraph blocks.
std::vector<float> bp1 =
gr::filter::firdes::band_pass(1.0, 5000000.0, 128000000.0,
132000000.0, 1000000.0);
std::vector<float> bp2 =
gr::filter::firdes::band_pass(1.0, 5000000.0, 128000000.0,
132000000.0, 1000000.0);
gr::filter::fir_filter_ccf::sptr filter1 =
gr::filter::fir_filter_ccf::make(1, bp1);
gr::filter::fir_filter_ccf::sptr filter2 =
gr::filter::fir_filter_ccf::make(1, bp2);
//head blocks
gr::blocks::head::sptr head1 =
gr::blocks::head::make(8,8448);
gr::blocks::head::sptr head2 = gr::blocks::head::make(8,
8448);
//skipheadblocks
gr::blocks::skiphead::sptr skip1 =
gr::blocks::skiphead::make(8, 256);
gr::blocks::skiphead::sptr skip2 =
gr::blocks::skiphead::make(8, 256);
//converters
gr::blocks::complex_to_float::sptr cf1 =
gr::blocks::complex_to_float::make();
gr::blocks::complex_to_float::sptr cf2 =
gr::blocks::complex_to_float::make();
gr::blocks::float_to_complex::sptr fc =
gr::blocks::float_to_complex::make();
//interleave
gr::blocks::interleave::sptr interleave =
gr::blocks::interleave::make(sizeof(gr_vector_float), 1);
//data file
gr::blocks::file_meta_sink::sptr file =
gr::blocks::file_meta_sink::make(8, "C:\\Program
Files\\GNURadio-3.7\\bin\\SDR.bin2", 5e6);
file->set_unbuffered(false);
//create a usrp device
std::cout << std::endl; //this should be commented out
gr::uhd::usrp_source::sptr usrp =
gr::uhd::usrp_source::make(device_args, stream_args);
......
As for attempted solutions i included the complex and xlocnum
but had no luck.
Another posible solution was that std:: is said to be
undefined behaviour, so i added "using namespace std;"(which
is suggested not to do but how else would i declare the
strings and vector<float>) and deleted the "std::" in
each line that contained it, but again no luck.
If anything is required of me do not hesitate to ask, any sort
of help is greatly appreciated.
Ill include the headers im using here also:
#include <iostream>
#include "stdafx.h"
#include <cmath>
#include <uhd/usrp_source.h>
#include <filter/firdes.h>
#include <gnuradio/filter/fir_filter_ccf.h>
#include <gnuradio/top_block.h>
#include <gnuradio/blocks/head.h>
#include <gnuradio/blocks/skiphead.h>
#include <gnuradio/blocks/complex_to_float.h>
#include <gnuradio/blocks/float_to_complex.h>
#include <gnuradio/blocks/interleave.h>
#include <gnuradio/blocks/file_meta_sink.h>
--