expected class-name before '{'

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bubzilla

    #1

    expected class-name before '{'

    Hi,

    i´ve got about 10 headerfiles with implemented classes. Now when i try

    to compile them i get the following message:


    In file included from Proxy/ServerCnx.hh:36 ,
    from Proxy/Payload.hh:30,
    ...
    from main.cc:28
    Proxy/Interface.hh:83 : error: expected class-name before '{'


    The Interface.hh looks like this:


    class Module : public ClientCnx{...}


    so far, i realisied that ClientCnx isn´t declarated. So I tried to
    make a forward Declaration
    by using


    class ClientCnx;


    but now, the compiler says:


    Proxy/Interface.hh:83 : error_ invalid use of undefined type `ClientCnx`

    Proxy/Interface.hh:30 : error_ forward declaration of `ClientCnx`


    now what can i do to fix this prob ?!?

  • Stuart Redmann

    #2
    Re: expected class-name before '{'

    bubzilla wrote:
    Hi,
    >
    i´ve got about 10 headerfiles with implemented classes. Now when i try
    to compile them i get the following message:
    >
    In file included from Proxy/ServerCnx.hh:36 ,
    from Proxy/Payload.hh:30,
    ...
    from main.cc:28
    Proxy/Interface.hh:83 : error: expected class-name before '{'
    >
    The Interface.hh looks like this:
    >
    class Module : public ClientCnx{...}
    >
    so far, i realisied that ClientCnx isn´t declarated. So I tried to
    make a forward Declaration
    by using
    >
    class ClientCnx;
    >
    A forward declaration isn't sufficient here, the compiler needs to see
    the whole declaration of the base classes.
    >
    but now, the compiler says:
    >
    Proxy/Interface.hh:83 : error_ invalid use of undefined type `ClientCnx`
    >
    Proxy/Interface.hh:30 : error_ forward declaration of `ClientCnx`
    >
    >
    now what can i do to fix this prob ?!?
    >
    Find the header file that declares the base class and include it before
    the declaration of Module.

    Regards,
    Stuart

    Comment

    • Gavin Deane

      #3
      Re: expected class-name before '{'


      bubzilla wrote:
      Hi,
      >
      i´ve got about 10 headerfiles with implemented classes. Now when i try
      >
      to compile them i get the following message:
      >
      >
      In file included from Proxy/ServerCnx.hh:36 ,
      from Proxy/Payload.hh:30,
      ...
      from main.cc:28
      Proxy/Interface.hh:83 : error: expected class-name before '{'
      >
      >
      The Interface.hh looks like this:
      >
      >
      class Module : public ClientCnx{...}
      >
      >
      so far, i realisied that ClientCnx isn´t declarated.
      That certainly sounds like a reasonable conclusion.
      So I tried to make a forward Declaration
      But why do you think a forward declaration would help?
      by using
      >
      >
      class ClientCnx;
      >
      >
      but now, the compiler says:
      >
      >
      Proxy/Interface.hh:83 : error_ invalid use of undefined type `ClientCnx`
      >
      Proxy/Interface.hh:30 : error_ forward declaration of `ClientCnx`
      >
      >
      now what can i do to fix this prob ?!?
      ClientCnx is a base class of Module and the compiler needs to know the
      full definition of ClientCnx before it sees Module. A forward
      declaration just tells the compiler that ClientCnx is the name of a
      class. That is not enough. You need to include the entire class
      definition of ClientCnx. If ClientCnx is defined in a header, #include
      that header above the definition of class Module.

      Gavin Deane

      Comment

      • bubzilla

        #4
        Re: expected class-name before '{'

        Ok, i had the same solution. So i tried to change the header includes,
        but some how i did got a way so that no error appears!

        so, do i have to try again, to find the right include order.

        Or can it be that there is somekind of circle that has to be solved in
        a other way?
        I'm not familiar how the Compiler brings the headerfiles together?

        Comment

        • Morten V Pedersen

          #5
          Re: expected class-name before '{'

          bubzilla wrote:
          Ok, i had the same solution. So i tried to change the header includes,
          but some how i did got a way so that no error appears!
          So it's working now?
          >
          so, do i have to try again, to find the right include order.
          >
          Or can it be that there is somekind of circle that has to be solved in
          a other way?
          I'm not familiar how the Compiler brings the headerfiles together?
          >
          It's the preprocessor that brings the header files together..

          You'll be getting multiple defined errors if you have cyclic includes..
          You can avoid that problem by using include guards:

          #ifndef SOME_UNIQUE_LAB EL
          #define SOME_UNIQUE_LAB EL
          code;
          #endif


          --
          // morten

          Comment

          • Stuart Redmann

            #6
            Re: expected class-name before '{'

            bubzilla wrote:
            Ok, i had the same solution. So i tried to change the header includes,
            but some how i did got a way so that no error appears!
            That's good.
            so, do i have to try again, to find the right include order.
            >
            Or can it be that there is somekind of circle that has to be solved in
            a other way?
            I'm not familiar how the Compiler brings the headerfiles together?
            Use include guards, as Morten suggests.

            If you build a class hierarchy you should always include any base
            classes in your header files before you declare the derived class:

            In base.h:
            #ifndef BASE_H_INCLUDED
            # define BASE_H_INCLUDED
            class Base
            {...};
            #endif

            In Derived.h:
            #ifndef DERIVED_H_INCLU DED
            # define DERIVED_H_INCLU DED
            class Derived : public Base
            {...};
            #endif

            If you have classes that have pointers to each other, you need forward
            declarations:

            In A.h:
            // Forward declaration of class B. Now the compiler
            // can handle pointers and references to class B,
            // provided they are not de-referenced.
            class B;
            class A
            {
            // Pointer to instance of class B
            class B* b;
            };

            in B.h:
            class B
            {
            // Pointer to instance of class A. Note the
            // class keyword, that is used as forward declaration
            // of name A.
            class A* b;
            };

            Regards,
            Stuart

            Comment

            • bubzilla

              #7
              Re: expected class-name before '{'


              :-(

              strange, i use include guards,
              and i use forward declarations for owner ship

              that´s why i posted in this group cause i just can´t find a reason!

              Comment

              • bubzilla

                #8
                Re: expected class-name before '{'

                Help help help, i´m haven´t found a solution yet! :-(

                Here is the order how the my Header files are included:

                main.cc
                #include "Proxy/RtspProxy.hh"

                RtspProxy.hh
                #include "InterfaceModul e.hh"

                InterfaceModule .hh
                #include "ServerCnx. hh"

                ServerCnx.hh
                #include "RtspProxy. hh"

                RtspProxy.hh
                #include "InterfaceModul e.hh" NO_MORE
                #include "ClientCnx. hh"

                ClientCnx.hh
                #include "Payload.hh "

                Payload.hh
                #include "ServerCnx. hh" NO_MORE
                Payload.code

                #include "ClientStream.h h"
                ClientCnx.code

                #include "ServerCnx. hh" NO_MORE
                #include "RtspMsg.hh "

                RtspMsg.hh
                RtspMsg.code

                #include "RtspController .hh"

                RtspController. hh
                #include "ClientCnx. hh" NO_MORE
                #include "SdpMsg.hh"

                SdpMsg.hh
                #include"RtspMs g.hh" NO_MORE
                SdpMsg.code

                #include "RtspMsg.hh " NO_MORE
                #include "Scheduler/Scheduler.hh"

                Scheduler.hh
                Scheduler.code

                #include "Socket.hh"

                Socket.hh
                Socket.code

                #include "Utils/Exception.hh"
                Utils/Exception.hh
                Utils/Exception.code

                RtspController. code

                #include "Socket.hh" NO_MORE
                #include "Scheduler/Scheduler.hh" NO_MORE
                #include "Utils/membind.hh"

                membind.hh
                membind.code

                RtspProxy.code

                #include "Payload.hh " NO_MORE
                #include "InterfaceModul e.hh" NO_MORE
                #include "ServerStream.h h"

                ServerStream.hh
                #include "ServerCnx. hh" NO_MORE
                #include "Socket.hh" NO_MORE
                #include "Scheduler/Scheduler.hh" NO_MORE
                ServerStream.co de

                #include "RtspController .hh" NO_MORE
                #include "RtspMsg.hh " NO_MORE
                #include "InterfaceList. hh"

                InterfaceList.h h
                InterfaceList.c ode

                #include "Socket.hh" NO_MORE
                ServerCnx::code

                #include "ClientCnx. hh" NO_MORE
                #include "InterfaceList. hh" NO_MORE
                InterfaceModule ::code

                #include "ClientCnx. hh" NO_MORE
                #include "ServerCnx. hh" NO_MORE
                #include "RtspMsg.hh " NO_MORE
                #include "RtspController .hh" NO_MORE
                #include "Socket.hh" NO_MORE
                #include "Scheduler/Scheduler.hh" NO_MORE
                #include "Utils/membind.hh"

                membind.hh
                membind.code

                RtspProxy::code
                main::code



                now i still get a error :

                in file: included from RtspProxy.hh:50 ,
                from ServerCnx.hh:34 ,
                from Payload.hh:30,
                from ClientCnx.hh:34 ,
                from ClientStream.hh :33,
                from ClientStream.cc :23:
                InterfaceModule .hh:87: error: incvlad use of undefined type `struct
                ClientCnx'
                RtspController. hh:59: error: forward declaration of `struct ClientCnx'


                OK, now in RtspController. hh I use a forward Declaration of ClientCnx
                cause I need the Class as the Type of an Parameter:

                ClientRtspContr oller( ClientCnx* )

                but later I need the Class as a Baseclass in InterfaceModule .hh:

                class PassthroughModu le : public ClientCnx

                i don´t get this thing fxxxing solved! ÄÄÄÄÄÄÄ

                Comment

                • Victor Bazarov

                  #9
                  Re: expected class-name before '{'

                  bubzilla wrote:
                  Help help help, i´m haven´t found a solution yet! :-(
                  >
                  Here is the order how the my Header files are included:
                  >
                  [...]
                  Make sure none of your headers have double inclusion guards that
                  share the same macro -- a common copy-paste mistake.

                  Without seeing the code nothing else springs to mind.

                  V
                  --
                  Please remove capital 'A's when replying by e-mail
                  I do not respond to top-posted replies, please don't ask


                  Comment

                  • Stuart Redmann

                    #10
                    Re: expected class-name before '{'

                    bubzilla wrote:
                    Help help help, i´m haven´t found a solution yet! :-(
                    >
                    Here is the order how the my Header files are included:
                    [snipped include graph]
                    >
                    now i still get a error :
                    >
                    in file: included from RtspProxy.hh:50 ,
                    from ServerCnx.hh:34 ,
                    from Payload.hh:30,
                    from ClientCnx.hh:34 ,
                    from ClientStream.hh :33,
                    from ClientStream.cc :23:
                    InterfaceModule .hh:87: error: incvlad use of undefined type `struct
                    ClientCnx'
                    RtspController. hh:59: error: forward declaration of `struct ClientCnx'
                    >
                    >
                    OK, now in RtspController. hh I use a forward Declaration of ClientCnx
                    cause I need the Class as the Type of an Parameter:
                    >
                    ClientRtspContr oller( ClientCnx* )
                    >
                    but later I need the Class as a Baseclass in InterfaceModule .hh:
                    >
                    class PassthroughModu le : public ClientCnx
                    >
                    i don´t get this thing fxxxing solved! ÄÄÄÄÄÄÄ
                    Could you make a copy of your source tree and take away all the
                    definitions that are not necessary for us to see? Take out all members
                    that are of a different type than the above classes. Also take out all
                    members that are pointers or references to any of the above classes.
                    Take away all base classes that don't belong to the offending hierarchy.

                    You should end up with classes that look like the following:

                    ClientCnx.hh (just an example, your code would certainly look different):
                    class ClientCnx : public InterfaceModule // Base class declaration that
                    // needs to see the class
                    // InterfaceModule
                    {
                    // Member that needs to see the class Payload.
                    Payload m_Payload;
                    };

                    Then post the headers and the offending .cpp file (that only needs to
                    contain the offending includes). Then we can have a look at it and
                    (hopefully) help you.

                    Stuart

                    Comment

                    • bubzilla

                      #11
                      Re: expected class-name before '{'

                      There are 3 headers:

                      InterfaceModule .hh
                      RtspController. hh
                      ClientCnx.hh

                      InterfaceModule .hh has a Derived Class and the Base is ClientCnx in
                      CLientCnx.hh,
                      RtspController has a Pointer on his owner, which is of type ClientCnx
                      and ClientCnx
                      like this


                      InterfaceModule .hh:
                      class Derived : public ClientCnx{ ... };

                      RtspController. hh:
                      class Controller {
                      ClientCnx ptr;
                      };

                      ClientCnx.hh:
                      class ClientCnx{
                      Controller ptr;
                      }

                      so, InterfaceModule .hh needs ClientCnx.hh be be included for the Base:
                      ClientCnx
                      and
                      ClientCnx.hh needs RtspController. hh to be included an i need a forward
                      declaration in RtspController. hh for ClientCnx

                      but then i compile, an error accures like

                      InterfaceModule .hh: error: incvlad use of undefined type `struct
                      ClientCnx'
                      RtspController. hh: error: forward declaration of `struct ClientCnx'

                      ???

                      Comment

                      • Earl Purple

                        #12
                        Re: expected class-name before '{'


                        bubzilla wrote:
                        There are 3 headers:
                        >
                        InterfaceModule .hh
                        RtspController. hh
                        ClientCnx.hh
                        >
                        InterfaceModule .hh has a Derived Class and the Base is ClientCnx in
                        CLientCnx.hh,
                        RtspController has a Pointer on his owner, which is of type ClientCnx
                        and ClientCnx
                        like this
                        It is preferable that your header includes the header it needs so that
                        your source files can include the headers they need in any order.

                        When you have a hierarchy of classes where one is an abstract base and
                        the other is simply an implementation that has no extra public methods,
                        it is preferable that only the implementation file for the derived
                        class and any closely associated classes know about the derived class
                        (thus including its header).


                        InterfaceModule .hh:
                        class Derived : public ClientCnx{ ... };
                        >
                        RtspController. hh:
                        class Controller {
                        ClientCnx ptr;
                        };
                        If Derived provides no new public methods of its own then most of your
                        source should be using ClientCnx, not Derived. Such source should be
                        including the header for ClientCnx (ClientCnx.hh) only.
                        ClientCnx.hh:
                        class ClientCnx{
                        Controller ptr;
                        }
                        >
                        so, InterfaceModule .hh needs ClientCnx.hh be be included for the Base:
                        ClientCnx
                        and
                        ClientCnx.hh needs RtspController. hh to be included an i need a forward
                        declaration in RtspController. hh for ClientCnx
                        What is Controller? You have called the member ptr so is it a pointer?
                        ClientCnx is a base class (possibly an abstract one). You haven't given
                        it any methods (nor terminated it with a semi-colon) but much of the
                        time abstract classes should not give away any of their implementation
                        detail, so if they do have any pointer members they should generally be
                        to only forwardly-declared classes. A lot of the time they will have no
                        member variables at all. Note that ClientCnx should also have either a
                        public virtual destructor or a protected non-virtual one.
                        but then i compile, an error accures like
                        >
                        InterfaceModule .hh: error: incvlad use of undefined type `struct
                        ClientCnx'
                        Because you didn't include it in the header. By the way, if the file is
                        called InterfaceModule .hh the class should probably be called
                        InterfaceModule and not Derived. InterfaceModule should be a type of
                        ClientCnx.
                        RtspController. hh: error: forward declaration of `struct ClientCnx'
                        It will need that forward declaration if it needs to know of ClientCnx
                        as a type but doesn't need to know anything else about it, i.e. its
                        size of any of its methods.

                        Comment

                        • Stuart Redmann

                          #13
                          Re: expected class-name before '{'

                          bubzilla wrote:
                          There are 3 headers:
                          >
                          InterfaceModule .hh
                          RtspController. hh
                          ClientCnx.hh
                          >
                          InterfaceModule .hh has a Derived Class and the Base is ClientCnx in
                          CLientCnx.hh,
                          RtspController has a Pointer on his owner, which is of type ClientCnx
                          and ClientCnx
                          like this
                          >
                          InterfaceModule .hh:
                          class Derived : public ClientCnx{ ... };
                          >
                          RtspController. hh:
                          class Controller {
                          ClientCnx ptr;
                          As you mentioned above, this should be a pointer (maybe this was the
                          fault all the time). In my example below I replaced this by
                          ClientCnx* ptr;
                          };
                          >
                          ClientCnx.hh:
                          class ClientCnx{
                          Controller ptr;
                          The same here.
                          }
                          >
                          so, InterfaceModule .hh needs ClientCnx.hh be be included for the Base:
                          ClientCnx
                          and
                          ClientCnx.hh needs RtspController. hh to be included an i need a forward
                          declaration in RtspController. hh for ClientCnx
                          >
                          but then i compile, an error accures like
                          >
                          InterfaceModule .hh: error: incvlad use of undefined type `struct
                          ClientCnx'
                          RtspController. hh: error: forward declaration of `struct ClientCnx'
                          >
                          Here is my version of the three headers:
                          ------------------------------------------------
                          ClientCnx.hh:
                          ------------------------------------------------
                          #ifndef _CLIENTCNX_HH
                          # define _CLIENTCNX_HH

                          // We don't need to see Controller here,
                          // since we only hold a pointer to this
                          // class.

                          // Forward declaration for Controller class.
                          class Controller;

                          class ClientCnx{
                          Controller* ptr;
                          };
                          #endif // _CLIENTCNX_HH

                          ------------------------------------------------
                          RtspController. hh:
                          ------------------------------------------------
                          #ifndef _RTSPCONTROLLER _HH
                          # define _RTSPCONTROLLER _HH


                          // We don't need to see ClientCnx here,
                          // since we only hold a pointer to this
                          // class.

                          // Forward declaration for ClientCnx class.
                          class ClientCnx;

                          class Controller
                          {
                          ClientCnx* ptr;
                          };

                          #endif // _RTSPCONTROLLER _HH
                          ------------------------------------------------
                          InterfaceModule .hh:
                          ------------------------------------------------
                          #ifndef _INTERFACEMODUL E_HH
                          # define _INTERFACEMODUL E_HH

                          // We need to see the whole definition
                          // of ClientCnx, since we derive from
                          // it.
                          #include "ClientCnx. hh"

                          class Derived : public ClientCnx
                          {
                          };

                          #endif // _INTERFACEMODUL E_HH
                          ------------------------------------------------
                          main.cpp:
                          ------------------------------------------------
                          #include "InterfaceModul e.hh"
                          int main ()
                          {
                          Derived Module;
                          return 0;
                          }

                          main.cpp compiles fine, although the compiler warns that the variable
                          Module is never used.

                          I hope this helps,
                          Stuart

                          Comment

                          • bubzilla

                            #14
                            Re: expected class-name before '{'


                            first of all: THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX
                            THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX
                            THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX
                            THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX
                            THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX
                            THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX
                            THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX
                            THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX
                            THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX
                            THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX
                            THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX
                            THANKX THANKX THANKX THANKX THANKX

                            second: it don´t work yet

                            third: here are all my relevant files and their includes:


                            main.cc
                            #include "Proxy/RtspProxy.hh"


                            RtspProxy.hh
                            #include "InterfaceModul e.hh"
                            #include "RtspController .hh"
                            #include "ClientCnx. hh"
                            #include "ServerCnx. hh"
                            #include "RtspMsg.hh "
                            #include "Socket.hh"
                            #include "Scheduler/Scheduler.hh"
                            #include "Utils/membind.hh"


                            InterfaceModule .hh
                            #include "RtspController .hh"
                            #include "InterfaceList. hh"


                            RtspController. hh
                            #include "ClientCnx. hh"
                            #include "SdpMsg.hh"
                            #include "RtspMsg.hh "
                            #include "Scheduler/Scheduler.hh"
                            #include "Socket.hh"
                            #include "Utils/Exception.hh"


                            ClientCnx.hh
                            #include "InterfaceList. hh"
                            #include "RtspMsg.hh "
                            #include "Payload.hh "
                            #include "ClientStream.h h"


                            ServerCnx.hh
                            #include "RtspProxy. hh"
                            #include "Payload.hh "
                            #include "InterfaceModul e.hh"
                            #include "ServerStream.h h"
                            #include "RtspController .hh"
                            #include "RtspMsg.hh "
                            #include "InterfaceList. hh"
                            #include "Socket.hh"


                            Payload.hh
                            #include "ServerCnx. hh"


                            ServerStream.hh
                            #include "ServerCnx. hh"
                            #include "Socket.hh"
                            #include "Scheduler/Scheduler.hh"



                            these are the includes in all headerfiles, some have no includes
                            my compiler says:

                            g++ -Wall -Woverloaded-virtual -Wno-long-long -pedantic -ansi -O0 -g
                            -fno-inline -I. -c -o main.o main.cc
                            g++ -Wall -Woverloaded-virtual -Wno-long-long -pedantic -ansi -O0 -g
                            -fno-inline -I. -c -o Proxy/ClientStream.o Proxy/ClientStream.cc
                            In file included from Proxy/RtspProxy.hh:50 ,
                            from Proxy/ServerCnx.hh:34 ,
                            from Proxy/Payload.hh:30,
                            from Proxy/ClientCnx.hh:34 ,
                            from Proxy/ClientStream.hh :33,
                            from Proxy/ClientStream.cc :23:
                            Proxy/InterfaceModule .hh:88: error: invalid use of undefined type
                            `struct satcom::rtspPro xy::ClientCnx'
                            Proxy/RtspController. hh:59: error: forward declaration of `struct
                            satcom::rtspPro xy::ClientCnx'
                            scons: *** [Proxy/ClientStream.o] Error 1
                            scons: building terminated because of errors.


                            and in RtspController. hh:59 is a forward declaration like this

                            ...
                            class ClientCnx;
                            class RtspController : boost::noncopya ble
                            ...

                            and in InterfaceModule .hh there is a class like this:

                            class PassthroughModu le
                            : public AbstractModule
                            , public ClientCnx
                            {
                            ...

                            Comment

                            • bubzilla

                              #15
                              Re: expected class-name before '{'


                              first of all: THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX
                              THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX
                              THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX
                              THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX
                              THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX
                              THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX
                              THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX
                              THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX
                              THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX
                              THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX
                              THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX THANKX
                              THANKX THANKX THANKX THANKX THANKX

                              second: it don´t work yet

                              third here are all my relevant files and their includes:




                              main.cc
                              #include "Proxy/RtspProxy.hh"


                              RtspProxy.hh
                              #include "InterfaceModul e.hh"
                              #include "RtspController .hh"
                              #include "ClientCnx. hh"
                              #include "ServerCnx. hh"
                              #include "RtspMsg.hh "
                              #include "Socket.hh"
                              #include "Scheduler/Scheduler.hh"
                              #include "Utils/membind.hh"


                              InterfaceModule .hh
                              #include "RtspController .hh"
                              #include "InterfaceList. hh"


                              RtspController. hh
                              #include "ClientCnx. hh"
                              #include "SdpMsg.hh"
                              #include "RtspMsg.hh "
                              #include "Scheduler/Scheduler.hh"
                              #include "Socket.hh"
                              #include "Utils/Exception.hh"


                              ClientCnx.hh
                              #include "InterfaceList. hh"
                              #include "RtspMsg.hh "
                              #include "Payload.hh "
                              #include "ClientStream.h h"


                              ServerCnx.hh
                              #include "RtspProxy. hh"
                              #include "Payload.hh "
                              #include "InterfaceModul e.hh"
                              #include "ServerStream.h h"
                              #include "RtspController .hh"
                              #include "RtspMsg.hh "
                              #include "InterfaceList. hh"
                              #include "Socket.hh"


                              Payload.hh
                              #include "ServerCnx. hh"


                              ServerStream.hh
                              #include "ServerCnx. hh"
                              #include "Socket.hh"
                              #include "Scheduler/Scheduler.hh"



                              these are the includes in all headerfiles, some have no includes
                              my compiler says:

                              g++ -Wall -Woverloaded-virtual -Wno-long-long -pedantic -ansi -O0 -g
                              -fno-inline -I. -c -o main.o main.cc
                              g++ -Wall -Woverloaded-virtual -Wno-long-long -pedantic -ansi -O0 -g
                              -fno-inline -I. -c -o Proxy/ClientStream.o Proxy/ClientStream.cc
                              In file included from Proxy/RtspProxy.hh:50 ,
                              from Proxy/ServerCnx.hh:34 ,
                              from Proxy/Payload.hh:30,
                              from Proxy/ClientCnx.hh:34 ,
                              from Proxy/ClientStream.hh :33,
                              from Proxy/ClientStream.cc :23:
                              Proxy/InterfaceModule .hh:88: error: invalid use of undefined type
                              `struct satcom::rtspPro xy::ClientCnx'
                              Proxy/RtspController. hh:59: error: forward declaration of `struct
                              satcom::rtspPro xy::ClientCnx'
                              scons: *** [Proxy/ClientStream.o] Error 1
                              scons: building terminated because of errors.


                              and in RtspController. hh:59 is a forward declaration like this

                              ...
                              class ClientCnx;
                              class RtspController : boost::noncopya ble
                              ...

                              and in InterfaceModule .hh there is a class like this:

                              class PassthroughModu le
                              : public AbstractModule
                              , public ClientCnx
                              {
                              ...

                              Comment

                              Working...