[ODE] OPCODE messing with variable scope? (MSVC6)

Chris Ledwith cledwith at d-a-s.com
Wed Sep 24 17:46:31 MST 2003


Hi all,
OPCODE seems to be doing something odd to how the MSVC6 compiler
interprets variable scope.

If I have something like:

#include <Opcode.h>

int a = 10;
for (int i=0; i<a; i++)
{
	// do something
}
for (i=0; i<a; i++)
{
	// do something else
}

I get "error C2065: 'i' : undeclared identifier" from MSVC6 at the start
of the second loop, as if the first declaration of i (at the start of
the first loop) gives it scope that is internal to the first loop only.
If I leave out #include "Opcode.h" this does not happen.

Could something in OPCODE's headers be changing a compiler setting?

Thanks,
Chris





More information about the ODE mailing list