Problem about "ErrorType" in file "NxOgreErro

mostfool

23-06-2007 13:23:27

In my own program, I only add the head file:
#include "NxOgre.h"
#include "Ogre.h"

When I compiled , there were some errors like this:

>d:\develop\nxogre\nxogre\include\nxogreerror.h(36) : error C2143: syntax error : missing '}' before '='
1>d:\develop\nxogre\nxogre\include\nxogreerror.h(36) : error C2059: syntax error : '='
1>d:\develop\nxogre\nxogre\include\nxogreerror.h(38) : error C2143: syntax error : missing ';' before '}'
1>d:\develop\nxogre\nxogre\include\nxogreerror.h(38) : error C2238: unexpected token(s) preceding ';'
1>d:\develop\nxogre\nxogre\include\nxogreerror.h(40) : error C2146: syntax error : missing ';' before identifier 'Type'
1>d:\develop\nxogre\nxogre\include\nxogreerror.h(40) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\develop\nxogre\nxogre\include\nxogreerror.h(40) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\develop\nxogre\nxogre\include\nxogreerror.h(49) : error C2061: syntax error : identifier 'PhysXDriver'
1>d:\develop\nxogre\nxogre\include\nxogreerror.h(52) : error C2061: syntax error : identifier 'ErrorReporter'
1>d:\develop\nxogre\nxogre\include\nxogreerror.h(53) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\develop\nxogre\nxogre\include\nxogreerror.h(53) : error C2143: syntax error : missing ',' before '&'
1>d:\develop\nxogre\nxogre\include\nxogreerror.h(56) : error C2146: syntax error : missing ';' before identifier 'getNewReport'
1>d:\develop\nxogre\nxogre\include\nxogreerror.h(56) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\develop\nxogre\nxogre\include\nxogreerror.h(56) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\develop\nxogre\nxogre\include\nxogreerror.h(56) : warning C4183: 'getNewReport': missing return type; assumed to be a member function returning 'int'
1>d:\develop\nxogre\nxogre\include\nxogreerror.h(66) : error C2146: syntax error : missing ';' before identifier 'mReporters'
1>d:\develop\nxogre\nxogre\include\nxogreerror.h(66) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\develop\nxogre\nxogre\include\nxogreerror.h(66) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\develop\nxogre\nxogre\include\nxogreerror.h(70) : error C2143: syntax error : missing ';' before '*'
1>d:\develop\nxogre\nxogre\include\nxogreerror.h(70) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\develop\nxogre\nxogre\include\nxogreerror.h(70) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\develop\nxogre\nxogre\include\nxogreerror.h(80) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\develop\nxogre\nxogre\include\nxogreerror.h(80) : error C2143: syntax error : missing ',' before '&'
1>d:\develop\nxogre\nxogre\include\nxogreerror.h(103) : error C2059: syntax error : '}'
1>d:\develop\nxogre\nxogre\include\nxogreerror.h(103) : error C2143: syntax error : missing ';' before '}'
1>d:\develop\nxogre\nxogre\include\nxogreerror.h(103) : error C2059: syntax error : '}'
1>d:\develop\nxogre\nxogre\include\nxogrelog.h(28) : error C2504: 'NxOgre::ErrorReporter' : base class undefined


I found the reason was in the file "NxOgreError.h".

namespace NxOgre {

struct ErrorReport {
NxString Caller;
NxString Message;

enum ErrorType {
CONFLICT = 0,
WARNING = 1,
FATAL_ERROR = 2,
DEBUG = 3, // Once remove this sentence ,it will work well
LEAK = 4,
};

ErrorType Type;
unsigned int frame;
float second;
};

Once I remove the "DEBUG = 3", or change "DEBUG" to another name. the compling will be successful.
What had happened ?

betajaen

23-06-2007 18:16:35

It was already predefined by the compiler, I need to change it.