×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    May 2011
    Posts
    48

    Question problem : Undefined symbol: 'class CCoeEnv * CCoeEnv::Static(void) (?Static@CCoeEnv@@

    helllo...
    i am new in symbian.c++ ......
    i use below code that was in my book.,
    but there is some problems :

    it s code :
    PHP Code:
    #include "CDelayedHello.h"
    #include "eikdef.h"
    #include "eikenv.h"
    void CDelayedHello::DoCancel()
        {
            
    iTimer.Cancel();
        }
    TInt CDelayedHello::RunError(TInt aError)
        {
            return 
    KErrNone;
        }
    EXPORT_C TInt CActive::RunError(TInt aError)
        {
            return 
    aError;
        }
    void CDelayedHello::RunL()
        {
            
    iEnv->InfoMsg(R_ACTIVEHELLO_TEXT_HELLO);
        }

    CDelayedHelloCDelayedHello::NewL()
        {
            
    CDelayedHelloself = new (ELeaveCDelayedHello();
            
    CleanupStack::PushL(self);
            
    self->ConstructL();
            
    CleanupStack::Pop(self);
            return 
    self;
        }
    CDelayedHello::CDelayedHello() : CActive(CActive::EPriorityStandard)
        {
            
    CActiveScheduler::Add(this);
        }
    void CDelayedHello::ConstructL()
        {
            
    iEnv CEikonEnv::Static();
            
    User::LeaveIfError(iTimer.CreateLocal());
        }
    CDelayedHello::~CDelayedHello()
        {
            
    Cancel();
            
    iTimer.Close();
        }    
    void CDelayedHello::SetHello(TTimeIntervalMicroSeconds32 aDelay)
        {
            
    iEnv->InfoMsg(R_ACTIVEHELLO_TEXT_HELLO);
        } 
    and its header :
    PHP Code:
    #ifndef CDELAYEDHELLO_H_
    #define CDELAYEDHELLO_H_

    #include <e32base.h>
    #include <eikdef.h>
    #include <eikenv.h>
    class CDelayedHello : public CActive
        
    {
    public:
        
    // Construct/destruct
        
    static CDelayedHelloNewL();
        ~
    CDelayedHello();
        
    // Request
        
    void SetHello(TTimeIntervalMicroSeconds32 aDelay);
        private:
        
    // Construct/destruct
        
    CDelayedHello();
        
    void ConstructL();
        
    // from CActive
        
    void RunL();
        
    void DoCancel();
        
    TInt RunError(TInt aError);
    private:
        
    RTimer iTimer// Has
        
    CEikonEnviEnv// Uses
        
    };

    #endif /* CDELAYEDHELLO_H_ */ 

    the problem is :
    PHP Code:
    Creation Time    Description    Resource    Path    Location    Type
    1308030934710    undefined identifier 
    'R_ACTIVEHELLO_TEXT_HELLO'    CDelayedHello.cpp    /test2/src    line 26    C/C++ Problem 
    and

    PHP Code:
    Creation Time    Description    Resource    Path    Location    Type
    1308030956070    Undefined symbol
    'class CCoeEnv * CCoeEnv::Static(void) (?Static@CCoeEnv@@SAPAV1@XZ)'    test2        Unknown    C/C++ Problem 

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,169

    Re: problem : Undefined symbol: 'class CCoeEnv * CCoeEnv::Static(void) (?Static@CCoeE

    you would need to define the resource R_ACTIVEHELLO_TEXT_HELLO in your resource file, and include the rsg file then in the cpp file where you are using it. If you have both points already handled, then see that your resource gets build without errors.

    For CCoeEnv, check SDK API docs, and make sure you include required header, as well as that your project mp file does also include any required libraries for the class.

Similar Threads

  1. Replies: 6
    Last Post: 2010-10-06, 17:34
  2. Replies: 7
    Last Post: 2009-10-15, 08:15
  3. how CCoeEnv::Static() implement
    By qxiaoyuan in forum Symbian
    Replies: 8
    Last Post: 2009-01-29, 02:22
  4. CCoeEnv::Static() is returning NULL pointer!
    By gwn-sameer in forum Symbian
    Replies: 2
    Last Post: 2007-11-12, 10:05
  5. Elements of CCoeEnv
    By keanu77 in forum Symbian
    Replies: 1
    Last Post: 2006-10-08, 18:49

Posting Permissions

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