Jump to content

View more

Image of the Day

雑魚は多めにして、爽快感重視にしつつ・・・(´・ω・`)
早いとこ、ベースを作って、完成にもっていかないとね。
タイトルもまだ迷ってるだよなぁ。 
#indiedev  #indiegame #screenshotsaturday https://t.co/IwVbswGrhe
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Errors in standard headers

4: Adsense

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   

1033
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.


#2 mordell   Members   

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   

1033
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   

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   

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   

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.