Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Expected ',' or '...' before 'protected' error!
Forum Updated to NodeBB v4.3 + New Features

Expected ',' or '...' before 'protected' error!

Scheduled Pinned Locked Moved General and Desktop
7 Posts 4 Posters 6.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TheDestroyer
    wrote on last edited by
    #1

    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 :-)

    1 Reply Last reply
    0
    • T Offline
      T Offline
      TheDestroyer
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • Z Offline
        Z Offline
        ZapB
        wrote on last edited by
        #3

        Please use "@" tags around code blocks. What line caused the compile error?

        Nokia Certified Qt Specialist
        Interested in hearing about Qt related work

        1 Reply Last reply
        0
        • JohanSoloJ Offline
          JohanSoloJ Offline
          JohanSolo
          wrote on last edited by
          #4

          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.

          `They did not know it was impossible, so they did it.'
          -- Mark Twain

          1 Reply Last reply
          0
          • T Offline
            T Offline
            TheDestroyer
            wrote on last edited by
            #5

            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!

            1 Reply Last reply
            0
            • G Offline
              G Offline
              giesbert
              wrote on last edited by
              #6

              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_RUN

              if 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

              @

              Nokia Certified Qt Specialist.
              Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

              1 Reply Last reply
              0
              • T Offline
                T Offline
                TheDestroyer
                wrote on last edited by
                #7

                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

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved