#### Archived

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

# 11 errors

This topic is 5638 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

VC++ keeps giving me 11 errors for some reason. Here they are: Font.cpp The purpose of this code is to make a class out of Nehe''s First Font tutorial: Lesson 13: Bitmap Fonts. 1)error C2144: syntax error : missing '';'' before type ''void'' 2)error C2501: ''WINGDIAPI'' : missing storage-class or type specifiers 3)fatal error C1004: unexpected end of file found Main.cpp 4)syntax error : missing '';'' before ''*'' 5)error C2501: ''g_font'' : missing storage-class or type specifiers 6)error C2227: left of ''->BuildFont'' must point to class/struct/union 7)error C2065: ''cnt1'' : undeclared identifier 8)fatal error C1903: unable to recover from previous error(s); stopping compilation NeHeGL.cpp 9)syntax error : missing '';'' before identifier ''g_isProgramLooping'' 10)''BOOL'' : redefinition; typedef cannot be overloaded with any other symbol 11)fatal error C1004: unexpected end of file found The first 3 errors point to gl.h. The 5th and 6th errors point to:
CFont*		g_font;

The 7th error points to:
g_font->BuildFont(-24,0,0,0,FW_BOLD,FALSE,FALSE,FALSE,			          ANSI_CHARSET,	OUT_TT_PRECIS,                   		  CLIP_DEFAULT_PRECIS,	CLIP_DEFAULT_PRECIS, 			  ANTIALIASED_QUALITY,FF_DONTCARE|DEFAULT_PITCH,		  "Courier New");

The 8th and 9th errors points to:
glColor3f(1.0f*float(cos(cnt1)),1.0f*float(sin(cnt2)),1.0f-0.5f*float(cos(cnt1+cnt2)));

The last error (the BOOL error) points to:
static BOOL g_isProgramLooping;

If you need any of the other code plez ask. Thanks in advance

##### Share on other sites
code?

BattleGuard

Only questions raise questions. Questions are raised by people, by curiousity, the gift of nature to all human beings. And curiosity is satisfied by answers, which in turn raise questions, which lead to answers. And this curiosity is what keeps SCIENCE alive...

##### Share on other sites
The full code can be found here: (thx to Error404)
http://rafb.net/paste/results/mk312489.html

The rest of the code is NeheGL.cpp|h which can be found on NeHe''s site:
http://www.nehe.gamedev.net

What person?
I forgot what I was gonna say.

##### Share on other sites
Looks like you forgot to include windows.h. Be sure to include it BEFORE gl.h as well.

##### Share on other sites
Thx but when i do that it changes teh redefined bool to redefinition of GLVOID and gives me 12 errors instead of 11...

What person?
I forgot what I was gonna say.

##### Share on other sites
But then what are these new 12 errors?

you NEED windows.h, no question there.

www.cppnow.com

##### Share on other sites
The new 12 errors are listed here:

http://rafb.net/paste/results/uk183198.html

##### Share on other sites
You made a very common error. You forgot to put a semicolon at the end of the class declaration.

class CFont
{
....
};

This causes a whole mumbo-jumbo of weird errors, that usually are non-errors but just problems arising from the missing semicolon.

I make this error all the time, but the shitload of errors usually indicates that this is the problem.

MindRazor

##### Share on other sites
OK i fixed the thing where it i was doing CFont::GLvoid and i also put that semicolon there. I had brough tit down to 11 errors with the GLvoid thing but with the semicolon there are now 18 errors which are lsited here:

http://rafb.net/paste/results/Y2357840.html

Thanks for all ure help so far.

##### Share on other sites
Seems like you need to include some header with some random global variables, include all headers in your project and it might work ^_ ^

1. 1
2. 2
3. 3
Rutin
20
4. 4
khawk
14
5. 5

• 9
• 11
• 11
• 23
• 12
• ### Forum Statistics

• Total Topics
633655
• Total Posts
3013187
×