Skip to main content
GameDev.net gamedev.net
šŸ”’ Locked

Real Easy Question

Started by Chipcrap Jun 29, 2000 at 1:06 PM 4 replies 200+ views
Original Post
Chipcrap
Chipcrap
typedef struct SPRITEHEAD_TAG { int width; LPDIRECTDRAWSURFACE surface; } SPRITEHEAD, *SPRITEHEAD_PTR; This code is in a header file but won''t compile. Here are the error messages: d:\chip''s crap\programs\game engine\engine.h(18) : error C2146: syntax error : missing '';'' before identifier ''surface'' d:\chip''s crap\programs\game engine\engine.h(18) : error C2501: ''LPDIRECTDRAWSURFACE'' : missing storage-class or type specifiers d:\chip''s crap\programs\game engine\engine.h(18) : error C2501: ''surface'' : missing storage-class or type specifiers I JUST DON''T GET IT!!!!!! HELP!
Jonathan
Jonathan
Make sure you''ve included ddraw.h

Jonathan
Chipcrap
Chipcrap
Yes-> ddraw is included in the cpp file. Infact I can use the code above as global variables and it workss fine-its just when I put it in a structure? Any other clues?
Chipcrap
Chipcrap
OK I got it-had to include ddraw.h in the header too--THANKS for the quick replies!
ape
ape
Don''t you have to include the ddraw.h in the header file chipcrap.h, and then include chipcrap.h in chipcrap.cpp? Mabey that''s what you''re doing but I didnt'' understand.
ape
ape
"had to include ddraw.h in the header too--"

..but you don''t HAVE to include it in the .cpp do you?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.