Errors in standard headers

Started by
4 comments, last by Machaira 24 years, 6 months ago

I am not sure, but I don't believe you are supposed to include winuser.h directly (I just have never done it, doesn't mean it can't be done).

include windows.h and it will pull in the necessary header information from its dependency headers.


HTH,

-mordell


__________________________________________

Yeah, sure... we are laughing WITH you ...
Advertisement
That seems to have done it - thanks! I wish there was some way of knowing these kinds of things. Including windows.h increased the compile time, but I guess that's the way it goes.

[This message has been edited by Machaira (edited October 21, 1999).]

Former Microsoft XNA and Xbox MVP | Check out my blog for random ramblings on game development

Machaira, I think you'll find that the more you program, the more things you'll need to know that aren't in books. At least that's been my experience thus far. Guards in header files, for example, I've yet to see described in any C++ book, yet they're absolutely necessary to learn. Maybe someone should write an "what the other books dont tell you" book one of these days. --Nolan
Nearly every programming book you will come across details include guards. I'm assuming you mean:

#ifndef __HEADER_H
#define __HEADER_H

// code goes here

#endif

I'm getting weird errors in headers that I'm including in my code. I included winuser.h to call the SetTimer and KillTimer functions and I get the following errors:

c:\microsoft visual studio\vc98\include\winuser.h(39) : error C2146: syntax error : missing ';' before identifier 'HDWP'
c:\microsoft visual studio\vc98\include\winuser.h(39) : fatal error C1004: unexpected end of file found

I get the same kind of problem when I include dsound.h. I get 14 errors from including that header.

I've added the dsound.lib to the Link tab of the project settings. User32.lib was already there for the winuser.h.

I'm stumped! Any help would be appreciated.

Former Microsoft XNA and Xbox MVP | Check out my blog for random ramblings on game development

JDudgeon, you missed my point entirely. Guards were merely an example I was using.

This topic is closed to new replies.

Advertisement