Jump to content

  • Log In with Google      Sign In   
  • Create Account


Errors in standard headers


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 Machaira   Moderators   -  Reputation: 1028

Like
Likes
Like

Posted 21 October 1999 - 08:23 AM

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.


Sponsor:

#2 mordell   Members   -  Reputation: 122

Like
Likes
Like

Posted 21 October 1999 - 04:13 AM

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




#3 Machaira   Moderators   -  Reputation: 1028

Like
Likes
Like

Posted 21 October 1999 - 07:02 AM

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).]


#4 nolan   Members   -  Reputation: 122

Like
Likes
Like

Posted 21 October 1999 - 07:18 AM

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

#5 JDudgeon   Members   -  Reputation: 122

Like
Likes
Like

Posted 21 October 1999 - 08:15 AM

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


#6 nolan   Members   -  Reputation: 122

Like
Likes
Like

Posted 21 October 1999 - 08:23 AM

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





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS