I have the following code:
public enum rkError : int {EC_SUCCESS,
EC_INVALID_FILE,
EC_UNDEFINED_HEADER,
EC_FILE_NOT_FOUND,
EC_CANNOT_CREATE};
...then, latter on:
int ok;
.
.
.
ok = hdr.Load();
if(ok!=rkError.EC_SUCCESS) return ok;
.
.
.
...as far as I understand, both ok and rkError.EC_SUCCESS are int, however the compiler complaints:
Error CS0019: Operator '!=' cannot be applied to operands of type 'int' and 'test.rkError'
so in order to run my program I must change the if line like this:
if(ok!=(int) rkError.EC_SUCCESS) return ok;
I don't understand why this is happening, since I took care of explicitly define rkError as int.
I'm using MonoDevelop instead of Visual Studio. Is this normal? am I doing something wrong?