Endless undefined reference errors

Login to reply to this topic.
Thu, 2008-05-29 23:13
Joined: 2008-05-26
Forum posts: 17

After the source is clean from carbide.c++ mistakes, it moves to this set of endless errors.
Can anyone shead some light?

Here is my cpp:

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


GLDEF_C TInt E32Main()
{
        CleanupStack* aCleanupStack = new (ELeave) CleanupStack;
        CActiveScheduler* aActiveScheduler = new (ELeave) CActiveScheduler;
        CTelephony *telephonyApi = CTelephony::NewLC();
        aCleanupStack->PushL(telephonyApi);
        CAnswer* iAnswer = new (ELeave) CAnswer(telephonyApi);
        aCleanupStack->PushL(iAnswer);
        iAnswer->ConstructL();
        iAnswer->RequestNotification();
        aActiveScheduler->Add(iAnswer);
        aActiveScheduler->Start();
return 0;
}

Here is the .h:

#ifndef CANSWER_H_
#define CANSWER_H_

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

class CAnswer : public CActive
{
public:
        void      ConstructL();        
                          CAnswer(CTelephony* aTelephony);
                         ~CAnswer();
        CAnswer*  NewLC(CTelephony* aTelephony);
        void          RequestNotification();
        
public:
        CAnswer* iCAnswer;

protected:
              
        virtual void DoCancel();
        virtual void RunL();
                       
private:
CTelephony* iTelephony;
CTelephony::TCallStatusV1 iLineStatus;
CTelephony::TCallStatusV1Pckg iLineStatusPckg;
CTelephony::TCallId aCallId;


};

void CAnswer::RequestNotification()
{
if (!IsActive())       
        {
                iTelephony->NotifyChange(iStatus, CTelephony::EVoiceLineStatusChange, iLineStatusPckg);
                SetActive();
        }
}

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

CAnswer::~CAnswer()
{
Cancel();
}

void CAnswer::RunL()
{
        if (iStatus==KErrNone)
        {
                if ( iLineStatus.iStatus == CTelephony::EStatusRinging )
                {
                        iTelephony->AnswerIncomingCall(iStatus, aCallId, CTelephony::EVoiceLine);
                }
        }
}

void CAnswer::ConstructL(){}

void CAnswer::DoCancel()
{
iTelephony->CancelAsync(CTelephony::EVoiceLineStatusChangeCancel);
CleanupStack::PopAndDestroy(iCAnswer);       
}

CAnswer* CAnswer::NewLC(CTelephony* aTelephony)
{
CAnswer* iCAnswer = new (ELeave) CAnswer(aTelephony); // First phase construction
CleanupStack::PushL(iCAnswer);
iCAnswer->ConstructL(); // Second phase construction
return (iCAnswer);
}



#endif /*CANSWER_H_*/

And here are the GCC errors:

..\..\..\..\..\EPOC32\BUILD\src\cedar\generic\BASE\E32\EEXE\ARMV5\UREL\uc_exe_.cpp:(.text+0x2): undefined reference to `User::Invariant()'                answering        line 0        1212098742671        1132
..\..\..\..\..\EPOC32\BUILD\src\cedar\generic\BASE\E32\EEXE\ARMV5\UREL\uc_exe_.cpp:(.text+0xa): undefined reference to `User::HandleException(void*)'                answering        line 0        1212098742671        1133
..\..\Symbian\9.1\S60_3rd\EPOC32\BUILD\answering\group\ANSWERING\GCCE\UREL\CAnswer.o:(.rodata+0x10): undefined reference to `CActive::Extension_(unsigned int, void*&, void*)'                answering        line 0        1212098742671        1129
..\..\Symbian\9.1\S60_3rd\EPOC32\BUILD\answering\group\ANSWERING\GCCE\UREL\CAnswer.o:(.rodata+0x1c): undefined reference to `CActive::RunError(int)'                answering        line 0        1212098742671        1130
..\..\Symbian\9.1\S60_3rd\EPOC32\BUILD\answering\group\ANSWERING\GCCE\UREL\CAnswer.o:(.rodata+0x34): undefined reference to `typeinfo for CActive'                answering        line 0        1212098742671        1131
Canswer.cpp:(.text._ZN12CleanupStack13PopAndDestroyEPv[_ZN12CleanupStack13PopAndDestroyEPv]+0x14): undefined reference to `CleanupStack::PopAndDestroy()'                answering        line 0        1212098742671        1125
Canswer.cpp:(.text._ZN5CBasenwEj6TLeave[_ZN5CBasenwEj6TLeave]+0x1c): undefined reference to `User::AllocZL(int)'                answering        line 0        1212098742671        1126
Canswer.cpp:(.text._ZN5TPckgIN10CTelephony13TCallStatusV1EEC1ERKS1_[_ZN5TPckgIN10CTelephony13TCallStatusV1EEC1ERKS1_]+0x28): undefined reference to `TPtr8::TPtr8(unsigned char*, int, int)'                answering        line 0        1212098742671        1128
Canswer.cpp:(.text._Znwj6TLeave[_Znwj6TLeave]+0x1c): undefined reference to `User::AllocL(int)'                answering        line 0        1212098742671        1127
Canswer.cpp:(.text+0x120): undefined reference to `CActive::CActive(int)'                answering        line 0        1212098742671        1104
Canswer.cpp:(.text+0x144): undefined reference to `CTelephony::TCallStatusV1::TCallStatusV1()'                answering        line 0        1212098742671        1105
Canswer.cpp:(.text+0x17c): undefined reference to `CActive::~CActive()'                answering        line 0        1212098742671        1106
Canswer.cpp:(.text+0x1c4): undefined reference to `CActive::Cancel()'                answering        line 0        1212098742671        1107
Canswer.cpp:(.text+0x1d8): undefined reference to `CActive::~CActive()'                answering        line 0        1212098742671        1108
Canswer.cpp:(.text+0x1ec): undefined reference to `CActive::~CActive()'                answering        line 0        1212098742671        1109
Canswer.cpp:(.text+0x240): undefined reference to `CActive::Cancel()'                answering        line 0        1212098742671        1110
Canswer.cpp:(.text+0x254): undefined reference to `CActive::~CActive()'                answering        line 0        1212098742671        1111
Canswer.cpp:(.text+0x268): undefined reference to `CActive::~CActive()'                answering        line 0        1212098742671        1112
Canswer.cpp:(.text+0x2c0): undefined reference to `CActive::Cancel()'                answering        line 0        1212098742671        1113
Canswer.cpp:(.text+0x2d4): undefined reference to `CActive::~CActive()'                answering        line 0        1212098742671        1114
Canswer.cpp:(.text+0x2e8): undefined reference to `CActive::~CActive()'                answering        line 0        1212098742671        1115
Canswer.cpp:(.text+0x378): undefined reference to `CTelephony::AnswerIncomingCall(TRequestStatus&, CTelephony::TCallId&, CTelephony::TPhoneLine) const'                answering        line 0        1212098742671        1116
Canswer.cpp:(.text+0x3c0): undefined reference to `CTelephony::CancelAsync(CTelephony::TCancellationRequest) const'                answering        line 0        1212098742671        1117
Canswer.cpp:(.text+0x414): undefined reference to `CleanupStack::PushL(CBase*)'                answering        line 0        1212098742671        1118
Canswer.cpp:(.text+0x464): undefined reference to `CActiveScheduler::CActiveScheduler()'                answering        line 0        1212098742671        1119
Canswer.cpp:(.text+0x46c): undefined reference to `CTelephony::NewLC()'                answering        line 0        1212098742671        1120
Canswer.cpp:(.text+0x478): undefined reference to `CleanupStack::PushL(CBase*)'                answering        line 0        1212098742671        1121
Canswer.cpp:(.text+0x4a0): undefined reference to `CleanupStack::PushL(CBase*)'                answering        line 0        1212098742671        1122
Canswer.cpp:(.text+0x4b8): undefined reference to `CActiveScheduler::Add(CActive*)'                answering        line 0        1212098742671        1123
Canswer.cpp:(.text+0x4bc): undefined reference to `CActiveScheduler::Start()'                answering        line 0        1212098742671        1124
Canswer.cpp:(.text+0x4c): undefined reference to `CTelephony::NotifyChange(TRequestStatus&, CTelephony::TNotificationEvent const&, TDes8&) const'                answering        line 0        1212098742671        1099
Canswer.cpp:(.text+0x54): undefined reference to `CActive::SetActive()'                answering        line 0        1212098742671        1100
Canswer.cpp:(.text+0x80): undefined reference to `CActive::CActive(int)'                answering        line 0        1212098742671        1101
Canswer.cpp:(.text+0xa4): undefined reference to `CTelephony::TCallStatusV1::TCallStatusV1()'                answering        line 0        1212098742671        1102
Canswer.cpp:(.text+0xdc): undefined reference to `CActive::~CActive()'                answering        line 0        1212098742671        1103
EUSER\epoc\arm\Uc_exe.cpp:(.text+0x18): undefined reference to `User::Exit(int)'                answering        line 0        1212098742671        1135
EUSER\epoc\arm\Uc_exe.cpp:(.text+0x6): undefined reference to `UserHeap::SetupThreadHeap(int, SStdEpocThreadCreateInfo&)'                answering        line 0        1212098742671        1134
symaehabi\Callfirstprocessfn.cpp:(.text+0x24): undefined reference to `User::InitProcess()'                answering        line 0        1212098742671        1136
symaehabi\Callfirstprocessfn.cpp:(.text+0x60): undefined reference to `User::Panic(TDesC16 const&, int)'                answering        line 0        1212098742671        1137


Fri, 2008-05-30 09:51
Joined: 2008-03-12
Forum posts: 30
Re: Endless undefined reference errors

Probably you forgot to add the required libraries in your mmp file? Such us
LIBRARY euser.lib etel3rdparty.lib
For example you see some undefined method from the UserHeap class you go to the doc you see that this class is defined in euser.lib you add euser.lib etc

  • Login to reply to this topic.