×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Dec 2006
    Posts
    12

    "undefined reference" Problem

    Hi All,
    Iam using carbide.C++ Express IDE & symbian sdk 8.1a to find IMEI number for S60 series with the help of mobinfo 1.01 API. when i tried to build the application the following errors occured.

    mobileinfo.in(mobileinfoEngine.o)(.text+0xa4):mobileinfoEngi: undefined reference to `CMobileInfo::NewL(void)'
    mobileinfo.in(mobileinfoEngine.o)(.text+0xa4):mobileinfoEngi: relocation truncated to fit: ARM_26 CMobileInfo::NewL(void)


    herewith i have also given the mmp file and cpp file.

    mobileinfo.mmp

    TARGET mobileinfo.app
    TARGETTYPE app
    UID 0x100039CE 0x0F4FECA6
    TARGETPATH \system\apps\mobileinfo

    SOURCEPATH ..\src
    SOURCE mobileinfoApp.cpp
    SOURCE mobileinfoAppui.cpp
    SOURCE mobileinfoDocument.cpp
    SOURCE mobileinfoContainer.cpp
    SOURCE mobileinfoEngine.cpp

    SOURCEPATH ..\data
    RESOURCE mobileinfo.rss
    RESOURCE mobileinfo_caption.rss
    LANG SC

    USERINCLUDE .
    USERINCLUDE ..\inc

    SYSTEMINCLUDE . \epoc32\include

    LIBRARY edllstub.lib
    LIBRARY euser.lib
    LIBRARY apparc.lib
    LIBRARY estlib.lib
    LIBRARY apparc.lib
    LIBRARY cone.lib
    LIBRARY eikcore.lib
    LIBRARY avkon.lib
    LIBRARY eikcoctl.lib
    LIBRARY efsrv.lib
    LIBRARY mobinfo.lib
    LIBRARY edbms.lib
    LIBRARY estor.lib
    LIBRARY flogger.lib
    LIBRARY commonengine.lib

    AIF mobileinfo.aif ..\aif mobileinfoaif.rss c8 context_pane_icon.bmp context_pane_icon_mask.bmp list_icon.bmp list_icon_mask.bmp


    mobileinfoEngine.cpp

    #include "mobileinfoEngine.h"
    #include "mobileinfo.h"
    #include "eikenv.h"
    #include "mobileinfoContainer.h"

    CMobileInfoActive * CMobileInfoActive ::NewL(CmobileinfoContainer* aAppView)
    {
    CMobileInfoActive * self=new(ELeave) CMobileInfoActive ;
    CleanupStack::PushL(self);
    self->ConstructL(aAppView);
    CleanupStack::Pop(self);
    return self;
    }

    CMobileInfoActive::CMobileInfoActive() : CActive(0)
    {
    mi = CMobileInfo::NewL();
    ni = CMobileNetworkInfo::NewL();

    CActiveScheduler::Add(this);
    }

    void CMobileInfoActive::ConstructL(CmobileinfoContainer* aAppView)
    {
    iAppView=aAppView;
    }

    CMobileInfoActive::~CMobileInfoActive()
    {
    Cancel();
    delete mi;
    delete ni;
    }

    void CMobileInfoActive::Start()
    {
    _LIT(KMobinfoPanic, "Mobinfo Test");
    __ASSERT_ALWAYS(!IsActive(), User::Panic(KMobinfoPanic, 1));

    state = 1;
    mi->GetIMSI(imsi, iStatus);
    SetActive();
    }

    void CMobileInfoActive::RunL()
    {
    if(state == 1)
    {
    state = 2;
    // iAppView->imsi = imsi;
    ShowText();

    mi->GetIMEI(imei, iStatus);
    SetActive();
    }
    else if(state == 2)
    {
    state = 3;
    // iAppView->imei = imei;
    ShowText();

    ni->GetCellId(cellid, iStatus);
    SetActive();

    }
    else if(state == 3)
    {
    state = 4;
    // iAppView->cellid = cellid().iCellId;
    ShowText();
    }


    }

    void CMobileInfoActive:oCancel()
    {

    }

    void CMobileInfoActive::ShowText()
    {
    iAppView->DrawNow();
    }



    what would be the cause for the errors?

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,572

    Re: "undefined reference" Problem

    You have not implemented the method in question.

  3. #3
    Super Contributor
    Join Date
    Mar 2003
    Posts
    580

    Re: "undefined reference" Problem

    I have same problem with completely different source:
    Code:
    // HelloWorld.cpp
    
    #include "CommonFramework.h"
    #include e32def.h
    #include f32file.h
    
    #include w32std.h     // RWsSession
    #include apgtask.h    // TApaTask, TApaTasksList 
    #include eikenv.h     // CEikonEnv::SetSystem()
    
    
    // do the example 
    LOCAL_C void doExampleL()
        {
    _LIT(KHelloWorldText,"Killer!!\n");
    console->Printf(KHelloWorldText);
    
    
    // Wap Browser's constants UId
    const TInt KWmlBrowserUid = 0x10008D39;
    TUid id( TUid::Uid( KWmlBrowserUid ) );
    
    TApaTaskList taskList( CEikonEnv::Static()->WsSession() );
    TApaTask task = taskList.FindApp( id );
    [...]
    Same happens with this "variant" (I'm experimenting with TApaTaskList to write an app which kilss foreground application):

    Code:
    // HelloWorld.cpp
    
    #include "CommonFramework.h"
    #include e32def.h
    #include f32file.h
    
    #include w32std.h     // RWsSession
    #include apgtask.h    // TApaTask, TApaTasksList 
    #include eikenv.h     // CEikonEnv::SetSystem()
    
    
    // do the example 
    LOCAL_C void doExampleL()
        {
    _LIT(KHelloWorldText,"Killer!!\n");
    console->Printf(KHelloWorldText);
    
    RWsSession iWsSession;
    User::LeaveIfError(iWsSession.Connect());
    CleanupClosePushL(iWsSession);
    
    TApaTaskList list(iWsSession);
    
    TApaTask task = list.FindByPos(0); // get fopreground app
    task.KillTask(); // kill it!
    [...]
    I'm quite new to Symbian c++, so I need some kind of "kick-start"...

    Note: why doesn't the forum allow to use "<" and ">" inside CODE tags???

  4. #4
    Super Contributor
    Join Date
    Mar 2003
    Posts
    580

    Re: "undefined reference" Problem

    Ok, solved; I mispelled a couple of .LIB files:
    #include <w32std.h> // RWsSession -->> ws32.lib
    #include <apgtask.h> // TApaTask, TApaTasksList -->> apgrfx.lib

  5. #5
    Super Contributor
    Join Date
    Mar 2003
    Posts
    580

    Re: "undefined reference" Problem

    This is the working source.
    Using "0" rather than "1" kills the... filemanager you used to start HELLOWORLD.EXE ,as "0" is the current foreground application.
    I guess that compiling shuch a code as a .APP rather than .EXE, I'll be able to add the app in the upper application bar of my UIQ phone; this should result in getting foreground application killed as soon as I click the icon of HELLOWORLD.APP .

    I'll try...

    Code:
    // HelloWorld.cpp
    
    #include "CommonFramework.h"
    #include <e32def.h>
    #include <f32file.h>
    
    #include <w32std.h>     // RWsSession
    #include <apgtask.h>    // TApaTask, TApaTasksList 
    #include <eikenv.h>     // CEikonEnv::SetSystem()
    
    
    // do the example 
    LOCAL_C void doExampleL()
        {
    _LIT(KHelloWorldText,"Killer!!\n");
    console->Printf(KHelloWorldText);
    
    
    
    RWsSession iWsSession;
    User::LeaveIfError(iWsSession.Connect());
    CleanupClosePushL(iWsSession);
    
    TApaTaskList list(iWsSession);
    
    TApaTask task = list.FindByPos(1); // 0 = get foreground app ; 1 = get launcher app of the .exe
    task.KillTask(); // kill it!
       	
    	}

Similar Threads

  1. Problem with eglSwapBuffers and heap corruption
    By greatape in forum Symbian Media (Closed)
    Replies: 2
    Last Post: 2007-05-24, 03:35
  2. netcards - Problem with opening adapter
    By kernj in forum Symbian Tools & SDKs
    Replies: 5
    Last Post: 2007-01-10, 08:56
  3. WAP service problem on Apache
    By bigg_o in forum Browsing and Mark-ups
    Replies: 3
    Last Post: 2005-04-17, 16:05
  4. Problem: S60 SDK for CW in PC with .NET
    By anttij in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2005-02-28, 11:36

Posting Permissions

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