×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Jan 2009
    Posts
    10

    Cannot compile inherited class! Please help!

    Hi, I am trying to compile a class that inherits a CActive base class. When I compile I keep getting a 'undefined identifier 'CMyInetBase'' error, where the CMyInetBase class is the CActive base class. There are no other errors in any of the classes other than this.

    I declare the class as:

    class CConnManager : public CMyInetBase
    { ... }

    Please help me to get this running!

  2. #2
    Nokia Developer Champion
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: Cannot compile inherited class! Please help!

    Have you added header file of CMyInetBase OR forward declaration of CMyInetBase to your file?

  3. #3
    Registered User
    Join Date
    Apr 2005
    Location
    Barcelona
    Posts
    1,678

    Re: Cannot compile inherited class! Please help!

    Quote Originally Posted by savaj View Post
    Have you added header file of CMyInetBase OR forward declaration of CMyInetBase to your file?
    In this case including the appropriate header is the only option.

  4. #4
    Registered User
    Join Date
    Jan 2009
    Posts
    10

    Re: Cannot compile inherited class! Please help!

    Yes the header file is included, and the path to it is correct

  5. #5
    Registered User
    Join Date
    Apr 2005
    Location
    Barcelona
    Posts
    1,678

    Re: Cannot compile inherited class! Please help!

    Could you post a minimal snippet showing CMyInetBase declaration?

  6. #6
    Registered User
    Join Date
    Jan 2009
    Posts
    10

    Re: Cannot compile inherited class! Please help!

    I'm not sure which snippet would be best. The connection manager inherits CInetBase, which inherits from CActive.
    Thanks

    CConnManager.h:
    Code:
    class CConnManager : public CMyInetBase
        {
        public: // Constructors and destructor
    
            /**
            * NewL
            * Construct a CConnManager
            * @param aLog the log to send output to
            * @return a pointer to the created instance of CConnManager
            */
            static CConnManager* NewL( CLogger& aLog, RSocketServ& aSocketServer, RConnection& aConnection);
            CConnManager( CLogger& aLog, RSocketServ& aSocketServer, RConnection& aConnection );
    ...
    CConnManager.h:
    Code:
    CConnManager::CConnManager( CLogger& aLog, RSocketServ& aSocketServer, RConnection& aConnection ) : 
        CMyInetBase( aLog )
        {
    	iLog = &aLog;
    	iSocketServer = &aSocketServer;
    	iConnection = &aConnection;
    
        iPort = KDefaultPortNumber;
        SetState( EDisconnected );
        }
    CMyInetBase.h:
    Code:
    class CMyInetBase : public CActive 
        {
        public: // Constructors and destructor
    
            /**
            * NewL()
            * Construct a CInetClient
            * @param aLog the log to send output to
            * @return a pointer to the created instance of CInetClient
            */
            static CMyInetBase* NewL( CLogger& aLog );
            CMyInetBase( CLogger& aLog );
    ...
    CMyInetBase.cpp:
    Code:
    CMyInetBase::CMyInetBase( CLogger& aLog )
        : CActive( CActive::EPriorityStandard )
        {
        iState = EWaitingToGetDevice;
        iLog = &aLog;
        iServerMode = EFalse;
        
        CActiveScheduler::Add( this );
        }

  7. #7
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,567

    Re: Cannot compile inherited class! Please help!

    Two things to check:
    - make sure that you use different guard macros in different header files
    - }; at the end of declaration of CMyInetBase.

Similar Threads

  1. java cimd application
    By vandana14 in forum General Messaging
    Replies: 3
    Last Post: 2011-04-07, 16:04
  2. Error preverifying class
    By rlatter in forum Mobile Java General
    Replies: 6
    Last Post: 2010-01-04, 15:10
  3. Java Application running on WTK but not on S60 SDK
    By roman.benz in forum Mobile Java Tools & SDKs
    Replies: 6
    Last Post: 2009-06-09, 14:38
  4. Help needed with +CPMS, +CNMI for Class 0,1,2 SMs
    By joe--joe in forum General Messaging
    Replies: 3
    Last Post: 2009-03-09, 14:55
  5. Replies: 3
    Last Post: 2004-07-16, 13:09

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •