C++ Newbie -- syntax error : missing ';' before identifier

Posted on 2006-03-22
Medium Priority
Last Modified: 2008-03-17
I'm new to C++... and what i am doing now is to add a very simple class to an existing HelloWorld program (for Symbian..but shouldn't matter i guess?)

However, when i compile, it always says SYNTAX ERROR : MISSING ';' BEFORE IDENTIFIER 'GetCount'.  ... And obviously i'm not missing any semicolon.. please HELP!

#ifndef __COUNTER_H__
#define __COUNTER_H__

class Counter {
            static void Start(void);
            static TInt GetCount(void) const;  // TInt is the int type for Symbian SDK
            static TInt mycount;

#endif //__COUNTER_H__

#include "counter.h"

void Counter::Start() {
      Counter::mycount = Counter::mycount + 1;

TInt Counter::GetCount() const {
  return Counter::mycount;


Question by:jtjli
LVL 27

Assisted Solution

Nopius earned 1000 total points
ID: 16266173
This message comes because you haven't included some Symbian specific header (where type TInt is defined).
Sorry, I don't know exactly which one.

Accepted Solution

enwhysee earned 1000 total points
ID: 16267550
As Nopius mentions, you'd need to include some header files. Try:

#include <e32base.h>
#include <e32cons.h>

at the top of your program

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is about my first experience with programming Arduino.
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Screencast - Getting to Know the Pipeline

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question