Click here to Skip to main content
12,547,501 members (41,448 online)
Rate this:
Please Sign up or sign in to vote.
See more: VC6 VC8.0 C++
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.
Posted 13-Mar-12 2:33am
Updated 13-Mar-12 6: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

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.161018.1 | Last Updated 14 Mar 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100