possible to re-install windows.h?

Started by
3 comments, last by teslaa66 15 years, 6 months ago
Is it possible to re-install windows.h with all or most of its components? only reason i say this is because any program i include windows.h in i have this error

Compiling...
main.cpp
vc98\include\winbase.h(6257) : error C2146: syntax error : missing ';' before identifier 'SetThreadToken'
vc98\include\winbase.h(6257) : fatal error C1004: unexpected end of file found
Error executing cl.exe.

i recently installed GLAUX.LIB, OPENGL32.LIB, glut32.lib, glu32.lib glu32.dll, glut32.dll, glut.dll, opengl32.dll GLU.H, GL.H, GLAUX.H, GL/GL.H, GL/GLAUX.H, GL/glext.h, GL/GLU.H, GL/glu_.h, GL/glut.h ****Please note that my first include is windows.h and if i do not include this my code compiles and runs fine ******
Advertisement
Quote:Original post by teslaa66
****Please note that my first include is windows.h and if i do not include this my code compiles and runs fine ******


There is nothing wrong with your Windows files. However, you are using GLUT, which happens to define Win32 constructs to avoid using windows.h. Here is their comment in the GLUT header file:
Quote:
/* 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. */


Can you please explain why you need to include "windows.h" if your code works fine without it? If you must absolutely have it, you might need to mess around with GLUT's header file or change the include order of your program.

If you do want to try to change the GLUT header, I'd try making # if 0 into # if 1 and only use that header file on Windows.
This might help: Using the Windows Headers
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man
i mean on the programs i dont include windows.h they compile and run fine. With my current project though i include windows so that i can delcare a BYTE and also a POINT.

BYTE x, y, z, padding;POINT pointCursorPos; md2loader.h(76) : error C2065: 'BYTE' : undeclared identifiermain.cpp(23) : error C2501: 'POINT' : missing storage-class or type specifiers


Literally the only time i get an error is when i include windows.h and this happens to even

#include <windows.h>#include <iostream>using namespace std;int main(){	cout << "hello";	return 0;}


works fine without but with it the compiler doesnt work
sorted thanks just copied the include directory over from my other computer and it sorted it

This topic is closed to new replies.

Advertisement