Archived

This topic is now archived and is closed to further replies.

Billy Lee

Help with simple error

Recommended Posts

I''ve written a header file which looks like this: #ifndef gf_included_Draw_h #define gf_included_Draw_h int DrawGLScene(GLvoid); #endif I get these errors though: --------------------Configuration: Lesson1 - Win32 Debug-------------------- Compiling... prog1.cpp main.cpp c:\program files\microsoft visual studio\myprojects\lesson1\draw.h(4) : warning C4518: ''int '' : storage-class or type specifier(s) unexpected here; ignored c:\program files\microsoft visual studio\myprojects\lesson1\draw.h(4) : error C2146: syntax error : missing '';'' before identifier ''DrawGLScene'' c:\program files\microsoft visual studio\myprojects\lesson1\draw.h(4) : fatal error C1004: unexpected end of file found Error executing cl.exe. Can someone please help me identify what is wrong?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Look at what is included before that header. The problem is likely to be an error in the previous header file, maybe a class declaration without a semicolon?

Share this post


Link to post
Share on other sites
Oh yeah! That was it. Another header file had a method declaration without a semicolon terminating the line. I didn''t know header files were dependant on one another.

Thanks for your help.

Share this post


Link to post
Share on other sites
They don''t depend on one another really, they''re just pasted right into where you include them. Missing semicolons is like a snow ball rolling down a hill, where the actual error you don''t find until everything after it starts reported really strange errors.

Share this post


Link to post
Share on other sites