GCCE compiler errors for active scheduler/object .exe

Login to reply to this topic.
Mon, 2008-05-26 17:41
Joined: 2008-05-26
Forum posts: 17

Hi,

I'm trying to compile an auto-answer-incoming-voice-call thread, using a CActive derived object, and a CActiveScheduler instance.
As you have probably been notified by the topic of this thread, the compiler fails to make my exe with "abld build GCCE" command.

My CActive derived class is autoAnswer .
I'm getting three "undifined reference to autoAnswer::member" errors from the GCCE compiler (S60 3rd).

autoAnswer() and DoCancel() for autoAnswer.o file, and RunError(int) for autoAnswer.exe which does not compile.

I probably do have multipe bugs but none should restrict compilation, as i AM declaring and defining those members, apart from RunError() which has a default CActive implementation if not declared.

If I wrote foolish code, you can laugh. Smiling

HEADER of autoAnswer:

#ifndef AUTOANSWER_H_
#define AUTOANSWER_H_

#include <e32base.h>
#include <etel3rdparty.h>

class autoAnswer : public CActive
{
public:
                      autoAnswer();
                      autoAnswer(CTelephony* aTelephony);
              virtual      ~autoAnswer();
                        void Cancel();
                void SetPriority(TInt aPriority);
                void RequestNotification();
                    
public:
        TRequestStatus iStatus;

private:
        CTelephony* iTelephony;
        CTelephony::TCallStatusV1 iLineStatus;
        CTelephony::TCallStatusV1Pckg iLineStatusPckg;
        CTelephony::TCallId iCallId;
        TBool iActive;

protected:
        virtual void RunL();
        virtual void DoCancel();
};

autoAnswer::~autoAnswer() { void cancel();}

autoAnswer::DoCancel() { iTelephony->CancelAsync(CTelephony::EVoiceLineStatusChange); }

autoAnswer::autoAnswer(CTelephony* aTelephony):
        CActive(EPriorityHigh),
        iTelephony( aTelephony ),
        iLineStatusPckg( iLineStatus )
       
        {
                iLineStatus.iStatus = CTelephony::EStatusUnknown;
        }

void autoAnswer::RequestNotification()
        {
                _LIT( KautoAnswerPANIC, "KautoAnswerPANIC" );
            __ASSERT_ALWAYS( !IsActive(), User::Panic( KautoAnswerPANIC, 1 ));
           
            iTelephony->NotifyChange(iStatus, CTelephony::EVoiceLineStatusChange, iLineStatusPckg);
            SetActive();
        }

void autoAnswer::RunL()
{
        if( iStatus==KErrNone )
        {
            if( iLineStatus.iStatus == CTelephony::EStatusRinging )
            {
                    iTelephony->AnswerIncomingCall(iStatus, iCallId, CTelephony::EVoiceLine );
                iLineStatus.iStatus = CTelephony::EStatusIdle;
                iActive=EFalse;
            }
        }
}

#endif

And here is the CPP:

#include "autoAnswer.h"
#include <e32base.h>
#include <etel3rdparty.h>

GLDEF_C TInt E32Main()
{
        CActiveScheduler* scheduler = new (ELeave) CActiveScheduler;
        CleanupStack::PushL(scheduler);
        CActiveScheduler::Install(scheduler);
        autoAnswer* obj = new (ELeave) autoAnswer;
        obj->autoAnswer::RequestNotification();
        scheduler->Add(obj);
        scheduler->Start();
       
return 0;
}


Mon, 2008-05-26 22:07
Joined: 2008-03-12
Forum posts: 30
Re: GCCE compiler errors for active scheduler/object .exe

CTelephony::EVoiceLineStatusChange is of type TNotificationEvent while CTelephony::CancelAsync() expects TCancellationRequest
You have to define autoAnswer::autoAnswer() since you call it in new (ELeave) autoAnswer.
TCallStatusV1Pckg can not be constructed directly. Its constructor requires an argument of TCallStatusV1 type such as iLineStatusPckg(iLineStatus)
With these changes and libraries euser and etel3rdparty in mmp file your code does compile and link.

However you should never write code like this one. As I'm not an expert myself I can't advise further but please read some good books on C++ and Symbian and you will soon understand.

  • Login to reply to this topic.