This error comes only when im working in a C file (not CPP)
I came across a very weird error while working on some opengl sample, I narrowed it down to below code, which produces the same error I’m getting, type not found
#include "stdlib.h"
void Initialize(int, char*[]);
void main()
{
}
void Initialize(int argc, char* argv[])
{
int i;
for(i = 10; i>0;i--)
{
int j=0;
j = j+2;
int GlewInitResult2;
}
}
I used visual studio 2008, OS: windows xp
cant understand why this is happening? is this a compiler bug?
(btw, it compiles fine if i save the file as a .CPP file)
You have declarations after statements. In newer versions of C (like C99), you can have this but in older versions you cannot. Microsoft’s C compiler is old. In C++ it’s OK, which is why it builds.