|
From: | Melvin J Malave Sanchez |
Subject: | Re: [Discuss-gnuradio] Global namespace Errors with Complex and xlocNum |
Date: | Wed, 15 Mar 2017 19:14:02 -0400 |
Hey :)
Ah, ok, didn't realize that. Looks like some compiler confusion, then. So, I've gotta admit, never tried to build GR with MSVC17, so here's a bit of guesswork:
* Not overly familiar with things under visual studio, but isn't it somehow customary to include stdafx.h as the very first thing?
* Since I don't immediately spot where you're using any of its functions: Why not remove #include <cmath> and see if it helps?
Best regards,
Marcus
PS: please make sure to keep the whole list in your replies – that way, more than one person has a chance to answer!
On 03/15/2017 08:41 PM, Melvin J Malave Sanchez wrote:
Hey Marcus,
thanks for the quick reply, the problem is more C++ oriented than GNU. But, im not using those math functions or any in fact explicitely anywhere in the code which leads me to believe the problem is related to the libraries and since you guys understand them more than i do im hoping for some insight on the issue.
Respectfully,
Melvin
On Mar 15, 2017 3:28 PM, "Marcus Müller" <address@hidden> wrote:
______________________________Hi Melvin,
Not 100% sure, it's getting late, but if you use #include cmath, wouldn't it be std::pow instead of pow? I don't really see the connection of your problem to GNU Radio, to be totally honest.
Best regards,
Marcus
On 03/15/2017 07:23 PM, Melvin J Malave Sanchez wrote:
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::ma ke(1, bp1);
gr::filter::fir_filter_ccf::sptr filter2 = gr::filter::fir_filter_ccf::ma ke(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::ma ke(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>
--
_______________________________________________ Discuss-gnuradio mailing list address@hidden https://lists.gnu.org/mailman/ listinfo/discuss-gnuradio _________________ Discuss-gnuradio mailing list address@hidden https://lists.gnu.org/mailman/ listinfo/discuss-gnuradio
[Prev in Thread] | Current Thread | [Next in Thread] |