All About Symbian - Nokia (S60) and Sony Ericsson (UIQ) smartphones unwrapped

  #1  
Old 01-10-2004, 09:29 AM
joape382 joape382 is offline
Registered User
 
Join Date: Sep 2004
Posts: 30
joape382 is on a distinguished road
Incredibly frustrating link error on static function

I can't figure out what the following error depends on. It is a link LNK2001
error and it is a static NewL function that is the trouble. The link error
is as following

--------------------Configuration: TERMINALAPP - Win32 Uni Debug--------------------
Compiling...
TerminalAppSaveForm.cpp
Doing first-stage link by name
link.exe @C:\DOCUME~1\Jocke\LOKALA~1\Temp\nma04064.
Creating library
\Symbian\6.1\Series60\EPOC32\BUILD\PROJEKT\TERMINA LAPP\GROUP\TERMINALAPP\WINS\UDEB\TERMINALAPP.lib and object
\Symbian\6.1\Series60\EPOC32\BUILD\PROJEKT\TERMINA LAPP\GROUP\TERMINALAPP\WINS\UDEB\TERMINALAPP.exp
TERMINALAPPCONTAINER.obj : error LNK2001: unresolved external symbol
"public: static class CTerminalAppSaveForm * __cdecl
CTerminalAppSaveForm::NewL(void)" (?NewL@CTerminalAppSaveForm@@SAPAV1@XZ)
\Symbian\6.1\Series60\EPOC32\BUILD\PROJEKT\TERMINA LAPP\GROUP\TERMINALAPP\WIN
S\UDEB\TERMINALAPP.APP : fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: 'link.exe' : return code '0x460'
Stop.
if exist
"\Symbian\6.1\Series60\EPOC32\BUILD\PROJEKT\TERMIN ALAPP\GROUP\TERMINALAPP\WINS\UDEB\TERMINALAPP.exp" del "\Symbian\6.1\Series60\EPOC32\BUILD\PROJEKT\TERMIN ALAPP\GROUP\TERMINALAPP\WINS\UDEB\TERMINALAPP.exp"
Stopped the build by removing the export object,
if present, because the pre-link stage failed
Linking...
LINK : fatal error LNK1104: cannot open file
"\Symbian\6.1\Series60\EPOC32\BUILD\PROJEKT\TERMIN ALAPP\GROUP\TERMINALAPP\WI
NS\UDEB\TERMINALAPP.exp"
Error executing link.exe.

TERMINALAPP.APP - 4 error(s), 0 warning(s)

The error puzzling me is

TERMINALAPPCONTAINER.obj : error LNK2001: unresolved external symbol
"public: static class CTerminalAppSaveForm * __cdecl
CTerminalAppSaveForm::NewL(void)" (?NewL@CTerminalAppSaveForm@@SAPAV1@XZ)

and it makes no sense to me since NewL function is both declared and
defined. I have copied the code from another example that works just fine.


Here's the code:

////////This code I beleive is relevant ///////////

--- TerminalAppContainer.cpp ---
#include "Terminalappcontainer.h"
#include "TerminalAppSaveForm.h"
#include "TerminalApp.hrh"

#include <aknutils.h> // for AKN_LAF_COLOR
#include <aknform.h>
#include <eiklabel.h> // for example label control
#include <eikedwin.h>
#include <eikenv.h>
#include <terminalapp.rsg>

void CTerminalAppContainer::ConstructL(const TRect& aRect)
{
CreateWindowL();

iLabel = new (ELeave) CEikLabel;
iLabel->SetContainerWindowL( *this );
iLabel->SetTextL( _L("Example View") );

iMobilNrEdwin = new (ELeave) CEikEdwin;
iMobilNrEdwin->SetContainerWindowL( *this );
iMobilNrEdwin->SetTextL( &(_L("Add tel no here")) );

SetRect(aRect);
ActivateL();
}

CTerminalAppContainer::~CTerminalAppContainer()
{
delete iLabel;
delete iMobilNrEdwin;
}

void CTerminalAppContainer::SizeChanged()
{
iLabel->SetExtent( TPoint(10,10), iLabel->MinimumSize() );
}

TInt CTerminalAppContainer::CountComponentControls() const
{
return 2;
}

CCoeControl* CTerminalAppContainer::ComponentControl(TInt aIndex) const
{
switch ( aIndex )
{
case 0:
return iLabel;
case 1:
return iMobilNrEdwin;
default:
return NULL;
}
}

void CTerminalAppContainer:raw(const TRect& aRect) const
{
CWindowGc& gc = SystemGc();

gc.SetPenStyle(CGraphicsContext::ENullPen);
gc.SetBrushColor(KRgbGray);
gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
gc.DrawRect(aRect);
}

void CTerminalAppContainer::HandleControlEventL(CCoeCon trol*
/*aControl*/,TCoeEvent /*aEventType*/)
{}

void CTerminalAppContainer:isplayFormL( TInt aResourceId )
{
CTerminalAppSaveForm* form = CTerminalAppSaveForm::NewL();
form->ExecuteLD( aResourceId );
}


--- TerminalAppSaveForm.h ---
#ifndef TERMINALAPPSAVETESTFORM_H
#define TERMINALAPPSAVETESTFORM_H

#include <aknform.h>
#include "TerminalApp.hrh"

class CTerminalAppSaveForm : public CAknForm
{
public:
static CTerminalAppSaveForm* NewL();
virtual ~CTerminalAppSaveForm();

TInt ExecuteLD( TInt aResourceId );
void PrepareLC( TInt aResourceId );

private:
CTerminalAppSaveForm();
void ConstructL();

void PostLayoutDynInitL();
TBool QuerySaveChangesL();
TBool SaveFormDataL();
void DoNotSaveFormDataL();

TBuf<EAknExFormEdwinMaxLength> iEdwinData1;
TInt iCurrentId;
};

#endif // AKNEXFORMSAVETESTFORM_H

--- TerminalAppSaveForm.cpp ---
#include <eikcapc.h>
#include <aknexform.rsg>
#include "TerminalAppSaveForm.h"

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

CTerminalAppSaveForm::~CTerminalAppSaveForm() {}
CTerminalAppSaveForm::CTerminalAppSaveForm() {}
void CTerminalAppSaveForm::ConstructL() { CAknForm::ConstructL(); }

TInt CTerminalAppSaveForm::ExecuteLD( TInt aResourceId )
{
iCurrentId = aResourceId;
return CAknForm::ExecuteLD( aResourceId );
}

void CTerminalAppSaveForm::PrepareLC( TInt aResourceId )
{
iCurrentId = aResourceId;
CAknForm::PrepareLC( aResourceId );
}

TBool CTerminalAppSaveForm::SaveFormDataL()
{
return ETrue;
}

void CTerminalAppSaveForm:oNotSaveFormDataL()
{
}

void CTerminalAppSaveForm::PostLayoutDynInitL()
{
CAknForm::PostLayoutDynInitL();
SaveFormDataL();
}

TBool CTerminalAppSaveForm::QuerySaveChangesL()
{
TBool isAnsYes(CAknForm::QuerySaveChangesL());

if (isAnsYes)
{
SaveFormDataL();
}
else
{
// Case that answer "No" to query.
DoNotSaveFormDataL();
}

return isAnsYes;
}


Hope someone can help me with this frustrating error.

/Joachim

  #2  
Old 22-11-2004, 07:46 PM
belapa
Guest
 
Posts: n/a
it seems to be a small error

check if you add TerminalAppSaveForm.cpp
into .mmp and rebuild the makefile before you compilation.

  #3  
Old 07-01-2005, 09:08 AM
Anon
Guest
 
Posts: n/a
many thanks from another beginner in compiling for symbian.

cheers,
/Anon.
Ads
 

Bookmarks

Tags
error, frustrating, function, incredibly, link, static

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT. The time now is 11:09 AM.


vBulletin skins developed by: eXtremepixels
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright Notes || Contact Us || Privacy Policy