×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Jan 2011
    Posts
    6

    SimpleEx Build Error - bracket?!

    G'Day,

    I'm having trouble building my 1st example file from the tutorial "SimpleEx" in Wileys "Developing Software for Symbian OS".
    Obviously, I'm fairly new to developing for Symbian - my goal is an app for my 6700 Slide (3rd edition FP2)

    I'm using:
    - Win XP
    - ActivePerl-5.6.1.635-MSWin32-x86.msi
    - S60_3rd_Edition_SDK_Feature_Pack_2_v1_1_en.zip
    - Carbide_cpp_v2_7_en.exe
    - Java 6.23

    Both command line and carbine building report error. The curious thing is, most/all of them point to the curly brackets *confused* :


    Code:
    /*=====================
      File: SimpleEx.cpp
    =====================*/
    #include <eikstart.h>
    #include "SimpleEx.h"
    // Create application object, return a pointer to it
    EXPORT_C CApaApplication* NewApplication()
    	{
    	return (static_cast<CApaApplication*>(new CSimpleExApplication));
    	}
    GLDEF_C TInt E32Main()
    	{
    	return EikStart::RunApplication( NewApplication );
    	}
    Code:
    /*==========================================================
    	File: SimpleEx_App.cpp
    	This file contains the application class for SimpleEx.
    ==========================================================*/
    #include "SimpleEx.h"
    CApaDocument* CSimpleExApplication::CreateDocumentL()
    	{
    	return new(ELeave) CSimpleExDocument(*this);
    	}
    TUid CSimpleExApplication::AppDllUid() const
    	{
    	return KUidSimpleExApp;
    	}
    Code:
    /*===============================================================
    	File: SimpleEx_View.cpp
    	This file contains the application view class for SimpleEx.
    ===============================================================*/
    #include "eikenv.h"
    #include <coemain.h>
    #include "SimpleEx.h"
    CSimpleExAppView* CSimpleExAppView::NewL(const TRect& aRect)
    	{
    	CSimpleExAppView* self = CSimpleExAppView::NewLC(aRect);
    	CleanupStack::Pop(self);
    	return self;
    	}
    CSimpleExAppView* CSimpleExAppView::NewLC(const TRect& aRect)
    	{
    	CSimpleExAppView* self = new (ELeave) CSimpleExAppView;
    	CleanupSTack::PushL(self);
    	self->ConstructL(aRect);
    	return self;
    	}
    void CSimpleExAppView::ConstructL(const TRect& aRect)
    	{
    	CreateWindowL();
    	SetRect(aRect);
    	ActivateL();
    	}
    void CSimpleExAppView::Draw(const TRect& ) const
    	{
    	CWindowGc& gc = SystemGc();
    	
    	TRect drawRect = Rect();
    	gc.Clear();
    	const CFont* font = iEikonEnv->TitleFont();
    	gc.UseFont(font);
    	TInt baselineOffset=(drawRect.Height() - font->HeightInPixels())/2;
    	gc.DrawText(_L("Simple Example"),drawRect,baselineOffset,CGraphicsContext::ECenter, 0);
    	gc.DiscardFont();
    	}
    Code:
    /*=================================================================
    	File: SimpleEx_UI.cpp
    	This file contains the application UI class for S60 SimpleEx.
    =================================================================*/
    #include "SimpleEx.h"
    void CSimpleExAppUi::ConstructL()
    	{
    	BaseConstructL(CAknEnableSkin);
    	iAppView = CSimpleExAppView::NewL(ClientRect());
    	}
    CSimpleExAppUi::~CSimpleExAppUi()
    	{
    	delete iAppView;
    	}
    void CSimpleExAppUi::HandleCommandL(TInt aCommand)
    	{
    	case EEikCmdExt:
    	case EAknSoftKeyExit:
    		Exit();
    		break;
    	case ESimpleExCommand:
    		{
    		_LIT(KMessage,"Start Selected!");
    		iEikonEnv->AlertWin(KMessage);
    		break;
    		}
    	}
    Code:
    Creation Time	Description	Resource	Path	Location	Type
    1296391666968	illegal access/using declaration	SimpleEx_App.cpp	/SimpleEx/src	line 7	C/C++ Problem
    1296391666969	illegal access/using declaration	SimpleEx_App.cpp	/SimpleEx/src	line 11	C/C++ Problem
    1296391666970	declaration syntax error	SimpleEx_App.cpp	/SimpleEx/src	line 14	C/C++ Problem
    1296391666971	declaration syntax error	SimpleEx.cpp	/SimpleEx/src	line 15	C/C++ Problem
    1296391666972	illegal access/using declaration	SimpleEx_View.cpp	/SimpleEx/src	line 9	C/C++ Problem
    1296391666973	illegal access/using declaration	SimpleEx_View.cpp	/SimpleEx/src	line 15	C/C++ Problem
    1296391666974	illegal access/using declaration	SimpleEx_View.cpp	/SimpleEx/src	line 22	C/C++ Problem
    1296391666975	illegal access/using declaration	SimpleEx_View.cpp	/SimpleEx/src	line 28	C/C++ Problem
    1296391666976	declaration syntax error	SimpleEx_View.cpp	/SimpleEx/src	line 38	C/C++ Problem
    1296391666977	illegal access/using declaration	SimpleEx_UI.cpp	/SimpleEx/src	line 7	C/C++ Problem
    1296391666978	declaration syntax error	SimpleEx_UI.cpp	/SimpleEx/src	line 11	C/C++ Problem
    1296391666980	declaration syntax error	SimpleEx_UI.cpp	/SimpleEx/src	line 27	C/C++ Problem
    1296391666979	illegal access/using declaration	SimpleEx_UI.cpp	/SimpleEx/src	line 16	C/C++ Problem
    I hope you can point me in the right direction -
    I double checked the writings in the book and everything looks exactly like -
    Thanks in advance!
    B.

  2. #2
    Registered User
    Join Date
    Feb 2007
    Location
    India
    Posts
    1,128

    Re: SimpleEx Build Error - bracket?!

    I want to know in which path you have create project ...???

    For Cross check....Run or import your Symbian\9.2\S60_3rd_FP2\S60Ex\helloworldbasic example .....

  3. #3
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,988

    Re: SimpleEx Build Error - bracket?!

    why only one header is included irrespective of what cpp file it is : #include "SimpleEx.h" ?

  4. #4
    Registered User
    Join Date
    Jan 2011
    Posts
    6

    Re: SimpleEx Build Error - bracket?!

    Quote Originally Posted by vineet.jain View Post
    why only one header is included irrespective of what cpp file it is : #include "SimpleEx.h" ?
    I followed exactly as the book says,
    here's the file:
    Code:
    #ifndef __SIMP_H
    #define __SIMP_H
    /*=====================
      S60 SimpleEx Header File
    ===================*/
    #include <eikenv.h>
    #include <eikon.hrh>
    #include "SimpleEx.hrh"
    
    #include <akndoc.h>
    #include <aknapp.h>
    #include <aknappui.h>
    #include "SimpleExUid.h"
    const TUid KUidSimpleExApp = {SIMPLEEXUID};
    
    // The Application Class
    class CSimpleExApplication : public CAknApplication
    	{
    	private:
    		CApaDocument* CreateDocumentL();
    		TUid AppDllUid() const;
    		};
    //The Application View Class
    class CSimpleExAppView : public CCoeControl
    	{
    	public:
    		static CSimpleExAppView* NewL(const TRect& aRect);
    		static CSimpleExAppView* CSimpleExAppView::NewLC(const TRect& aRect);
    		void ConstructL(const TRect& aRect);
    	private:
    		void Draw(const TRect&) const;
    		};
    // The UI Class
    class CSimpleExAppUi : public CAknAppUi
    	{
    	public: 
    		void ConstructL();
    		~CSimpleExAppUi();
    	private:
    		void HandleCommandL(TInt aCommand);
    		CSimpleExAppView* iAppView;
    		};
    // The Application Document Class
    class CSimpleExDocument : public CAknDocument
    	{
    	public:
    		CSimpleExDocument(CEikApplication& aApp): CAknDocument (aApp) {}
    	private:
    		CEikAppUi* CreateAppUiL();
    #endif

    Quote Originally Posted by kis_spn View Post
    I want to know in which path you have create project ...???
    I wrote all the files from scratch (notepad plus - for learning I think it's necessary to create every file myself, learning by doing ), tried building it in command line and tried carbine after importing.

    project path is: C:\Symbian\Carbide\workspace\SimpleEx


    Quote Originally Posted by kis_spn View Post
    For Cross check....Run or import your Symbian\9.2\S60_3rd_FP2\S60Ex\helloworldbasic example .....
    both command line and import in carbine work properly,
    path: C:\S60\devices\S60_3rd_FP2_SDK_v1.1\S60CppExamples\helloworldbasic
    Last edited by Baschdl; 2011-01-30 at 14:07.

  5. #5
    Registered User
    Join Date
    Jan 2011
    Posts
    6

    Re: SimpleEx Build Error - bracket?!

    alright, I found a typo at the end of SimpleEx.h
    one missing curved bracket - in the book as well

    Code:
    class CSimpleExDocument : public CAknDocument
    	{
    	public:
    		CSimpleExDocument(CEikApplication& aApp): CAknDocument (aApp) {}
    	private:
    		CEikAppUi* CreateAppUiL();
    };

    but now I encounter an "undefined identifier " in SimpleEx_UI.cpp:
    Code:
    Code:
    /*=================================================================
    	File: SimpleEx_UI.cpp
    	This file contains the application UI class for S60 SimpleEx.
    =================================================================*/
    #include "SimpleEx.h"
    void CSimpleExAppUi::ConstructL()
    	{
    	BaseConstructL(CAknEnableSkin);
    	iAppView = CSimpleExAppView::NewL(ClientRect());
    	}
    CSimpleExAppUi::~CSimpleExAppUi()
    	{
    	delete iAppView;
    	}
    void CSimpleExAppUi::HandleCommandL(TInt aCommand)
    	{
    	switch(aCommand)
    		{
    		case EEikCmdExit:
    		case EAknSoftkeyExit:
    			Exit();
    			break;
    		case ESimpleExCommand:
    			{
    			_LIT(KMessage,"Start Selected!");
    			iEikonEnv->AlertWin(KMessage);
    			break;
    			}
    		}
    	}
    carbide view:
    Last edited by Baschdl; 2011-01-30 at 15:09.

  6. #6
    Registered User
    Join Date
    Jan 2011
    Posts
    6

    Re: SimpleEx Build Error - bracket?!

    Quote Originally Posted by Baschdl View Post
    but now I encounter an "undefined identifier " in SimpleEx_UI.cpp:
    Code:
    Code:
    	BaseConstructL(CAknEnableSkin);
    omg... another typo in the book:
    google gave me a solution: EAknEnableSkin

  7. #7
    Registered User
    Join Date
    Dec 2009
    Posts
    339

    Re: SimpleEx Build Error - bracket?!

    you made another typo, use EAknEnableSkin

Similar Threads

  1. Replies: 7
    Last Post: 2011-01-20, 10:18
  2. RVCT v2.2 build 435 build error
    By asheesh_v in forum Symbian
    Replies: 2
    Last Post: 2010-04-30, 07:35
  3. func req: double click beginning bracket, code in the scope is highlighted.
    By useryy in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 4
    Last Post: 2008-09-11, 06:42
  4. Replies: 2
    Last Post: 2007-05-24, 12:03
  5. Build error when trying to build for real target
    By aehrath in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2003-07-04, 16:10

Posting Permissions

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