Jordan
Jordan

Reputation: 9114

Can't figure out error

I'm trying to get google glog to work with windows, but I get these errors that I can't figure out.

// Variables of type LogSeverity are widely taken to lie in the range
// [0, NUM_SEVERITIES-1].  Be careful to preserve this assumption if
// you ever need to change their values or add a new severity.
typedef int LogSeverity;

const int INFO = 0;
const int WARNING = 1; 
const int ERROR = 2;
const int FATAL = 3;
const int NUM_SEVERITIES = 4;


1>c:\users\<me>\documents\visual studio 2008\projects\sampleproj\sampleproj\src\windows\glog\log_severity.h(53) : warning C4091: '' : ignored on left of 'const int' when no variable is declared
1>c:\users\<me>\documents\visual studio 2008\projects\sampleproj\sampleproj\src\windows\glog\log_severity.h(53) : error C2143: syntax error : missing ';' before 'constant'
1>c:\users\<me>\documents\visual studio 2008\projects\sampleproj\sampleproj\src\windows\glog\log_severity.h(53) : error C2059: syntax error : 'constant'

Upvotes: 0

Views: 1665

Answers (3)

AnT stands with Russia
AnT stands with Russia

Reputation: 320719

Your identifiers are conflicting with some macro names defined somewhere else. You have probably included some Windows header file that already defines a macro with such name.

Upvotes: 0

Robᵩ
Robᵩ

Reputation: 168816

The code you don't show has this line:

#define INFO 0

This means that the code you did show is seen by the compiler as this:

const int 0 = 0;

which, of course, won't compile.

Upvotes: 2

Vlad
Vlad

Reputation: 35594

The mistake should be somewhere else, maybe in a previous header?

The code you posted compiles without problems: http://ideone.com/Wf64q

Upvotes: 1

Related Questions