Expected ',' or '...' before 'protected' error!
-
Hello guys, :-)
I'm creating an OpenGL simulation for my simulation program. I included the header files from my simulation in my Qt program. I got this error while trying to compile.
the whole class I'm using is as follows:
@
class LowPassGaussian
{
double currValue;
const gsl_rng_type *T;
gsl_rng r;
public:
LowPassGaussian();
bool lowPassGaussianStep(double &signal, double cutoff_freq, double amplitude, double sampling_rate);
bool lowPassGaussianStep(const vector<double> &signals, double cutoff_freq, double amplitude, double sampling_rate); //error occurs here at the vector part
};
@Note: I have "using namespace std" at the beginning of the file. And I tried adding std:: to the vector definion but no use!!!
This program is compiling on Linux g++ with no problems, but on windows with MinGW and QT it doesn't compile.
Could you guys please help? I don't really know how to start with this! I tried everything I know!!!
Thank you :-)
-
I'm sorry, I don't mean the same program compiles on Linux. I mean the header files I'm using compile on Linux. The same problems occur on linux when compiling through Qt.
-
Could you please post the error you're getting, and the complete file where the LowPassGaussian lies?
As several people usually say, the crystal ball doesn't always works.Also : please use @ tags to have a proper rendering of the C++ code, and it's Qt not QT.
-
This is my first time in this forum. I'm sorry I didn't know about the "@" thingy. Thank you for fixing my code.
The line that caused the error is the line that contains a function with first parameter vector<double*>. The line is marked with a comment at the end of it.
@
#include <string>
#include <vector>
#include <gsl/gsl_errno.h>
#include <gsl/gsl_fft_real.h>
#include <gsl/gsl_randist.h>
#include <gsl/gsl_math.h>
#include "../libsrc/Exception_sam_base.h"
#include "../libsrc/ToString.h"using namespace std;
class HighPass
{
double prevOutput, prevInput, currInput, currOutput;
public:
HighPass();
void highPassStep(double &input, double &output, double time_const);
void highPassRandomStep(double &signal, double time_const, double amplitude);
};class LowPassGaussian
{
double currValue;
const gsl_rng_type *T;
gsl_rng r;
public:
LowPassGaussian();
bool lowPassGaussianStep(double &signal, double cutoff_freq, double amplitude, double sampling_rate);
bool lowPassGaussianStep(const vector<double> &signals, double cutoff_freq, double amplitude, double sampling_rate); //error here
};
@The file is big and contains other classes. I posted here everything and removed the other classes. I hope this suffices
Thank you in advance!
-
is this file a Qt File?
Does it include soem Qt headers in some way?I ask as signals is a pre processor define in Qt!
signals is defines in <QtPath>\src\corelib\kernel\qobjectdefs.h
@
#ifndef Q_MOC_RUNif defined(QT_NO_KEYWORDS)
define QT_NO_EMIT
else
define slots
define signals protected // this leads to problems in your code
endif
define Q_SLOTS
define Q_SIGNALS protected
define Q_PRIVATE_SLOT(d, signature)
define Q_EMIT
ifndef QT_NO_EMIT
define emit
endif
@
-
I got it guys! the word "signals" is reserved in Qt!! that's it!! I changed it and everything went fine! :D
OMG!! this is very embarrassing :$
Thanks for you efforts guys! :D