this is a part of my engine's stdafx.h:
#define WIN32_LEAN_AND_MEAN /* Exclude rarely-used stuff from Windows headers */#include <windows.h>#pragma comment (lib, "winmm.lib") /* link with Windows MultiMedia lib */#pragma comment (lib, "opengl32.lib") /* link with Microsoft OpenGL lib */#pragma comment (lib, "glu32.lib") /* link with OpenGL Utility lib */#pragma warning (disable:4244) /* Disable bogus conversion warnings. */#pragma warning (disable:4305) /* VC++ 5.0 version of above warning. */#include <GL/gl.h>#include <GL/glu.h>
.lib errors would be linking errors, not compiling errors.
petewood, so yes i included windows.h
edit: i had no errors when i used glut (i included glut.h only when i used)
i dont know if it is useful, but this is the beginning of glut.h:
#if defined(_WIN32)/* GLUT 3.7 now tries to avoid including <windows.h> to avoid name space pollution, but Win32's <GL/gl.h> needs APIENTRY and WINGDIAPI defined properly. */# if 0# define WIN32_LEAN_AND_MEAN# include <windows.h># else /* XXX This is from Win32's <windef.h> */# ifndef APIENTRY# define GLUT_APIENTRY_DEFINED# if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED)# define APIENTRY __stdcall# else# define APIENTRY# endif# endif /* XXX This is from Win32's <winnt.h> */# ifndef CALLBACK# if (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS)# define CALLBACK __stdcall# else# define CALLBACK# endif# endif /* XXX This is from Win32's <wingdi.h> and <winnt.h> */# ifndef WINGDIAPI# define GLUT_WINGDIAPI_DEFINED# define WINGDIAPI __declspec(dllimport)# endif /* XXX This is from Win32's <ctype.h> */# ifndef _WCHAR_T_DEFINEDtypedef unsigned short wchar_t;# define _WCHAR_T_DEFINED# endif# endif#pragma comment (lib, "winmm.lib") /* link with Windows MultiMedia lib */#pragma comment (lib, "opengl32.lib") /* link with Microsoft OpenGL lib */#pragma comment (lib, "glu32.lib") /* link with OpenGL Utility lib */#pragma comment (lib, "glut32.lib") /* link with Win32 GLUT lib */#pragma warning (disable:4244) /* Disable bogus conversion warnings. */#pragma warning (disable:4305) /* VC++ 5.0 version of above warning. */#endif#include <GL/gl.h>#include <GL/glu.h>
i copied-pasted this code to replace my current code, but i got the same errors and even more errors because i use thingys that defined in windows.h