Click here to Skip to main content
14,693,599 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Experts,

I have a piece of code in one header file as follows.

#pragma once

const unsigned int RATE    = 100;
const unsigned int TIMEOUT = 20;
const unsigned int REPORT = 1000;

enum STATUS_TYPE1 {X = 0, Y = 1, Z = 2, A = 3};
enum STATUS_TYPE2  {D = 0, E = 1, F = 2, G = 3, H = 4};

But when I tried to build the project I am getting the following error.

"syntax error : missing '}' before 'constant'"
"syntax error : missing ';' before 'constant'"
"syntax error : 'constant'"
"missing ';' before '}'"
"syntax error : '}'"

All these errors are pointing to the same line(enum STATUS_TYPE2 {D = 0, E = 1, F = 2, G = 3, H = 4};)

It is killing my time.. Can any one help me on this?

Note: Actually I am exporting the above code from VC6 to VC8.
Updated 13-Mar-12 7:45am
Rahul Rajat Singh 13-Mar-12 8:50am
It is working fin on my end. could you provide more info i.e. project type, IDE, compiler etc.
Maximilien 13-Mar-12 9:06am
compiles ok on VS2008, the error must be somewhere else.

1 solution

It looked puzzling to me. In disbelieve, I tried to compile it: I was right — it works fine. The problem is somewhere else; there is something you don't show to us. :-(


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900