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

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;


Who is Participating?
As Nopius mentions, you'd need to include some header files. Try:

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

at the top of your program
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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.