W
Webster
Hello,
I am having a problem with the order of the #includes in C++. When I
compile it in VC++ 6.0 it gives me no problems, but when I try it out in
VS.NET, it gives me a redefinition error:
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\stdlib.h(251):
error C2381: 'exit' : redefinition; __declspec(noreturn) differs
So I tried different orders of the includes, but no matter if I include the
<windows.h> first or the <stdlib.h> first, it always complains. Please note
that this is not my code, but I am supposed to use it as "helpful" template
code. Can anyone shed some light on the subject???
Thanks. See below for my #includes.
--
Regards,
Webster
Original Code:
---------------
#ifdef WIN32
#include <windows.h>
#endif
#include <GL/gl.h>
#include <GL/glu.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glut.h>
#include <iostream.h>
The way I currently have:
--------------------------
#ifdef WIN32
#include <windows.h>
#endif
//#include <iostream.h>
//#include <stdio.h>
//#include <math.h>
//#include <stdlib.h> <--- commented this out because i suspected that
the <windows.h> file should have defined exit
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
I am having a problem with the order of the #includes in C++. When I
compile it in VC++ 6.0 it gives me no problems, but when I try it out in
VS.NET, it gives me a redefinition error:
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\stdlib.h(251):
error C2381: 'exit' : redefinition; __declspec(noreturn) differs
So I tried different orders of the includes, but no matter if I include the
<windows.h> first or the <stdlib.h> first, it always complains. Please note
that this is not my code, but I am supposed to use it as "helpful" template
code. Can anyone shed some light on the subject???
Thanks. See below for my #includes.
--
Regards,
Webster
Original Code:
---------------
#ifdef WIN32
#include <windows.h>
#endif
#include <GL/gl.h>
#include <GL/glu.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glut.h>
#include <iostream.h>
The way I currently have:
--------------------------
#ifdef WIN32
#include <windows.h>
#endif
//#include <iostream.h>
//#include <stdio.h>
//#include <math.h>
//#include <stdlib.h> <--- commented this out because i suspected that
the <windows.h> file should have defined exit
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>