Lesson 8 Error
-
- Posts: 3
- Joined: December 7th, 2012, 5:19 am
Lesson 8 Error
This error occurs when Chili makes the DrawReticle function in the Game.h file for the first time.
It lets me declare it there, but when I repeat it in the Game.cpp file, typing:
void Game::DrawReticle(int x,int y,int r,int g,int b);
{
...Reticle code...
}
I get two errors when I try to compile:
error C2761: 'void Game::DrawReticle(int,int,int,int,int)' : member function redeclaration not allowed
error C2447: '{' : missing function header (old-style formal list?)
The first one goes away if I remove the Game:: before DrawReticle, but the other remains.
The last one is referring to the first '{' following the function.
I'm also getting a
fatal error C1075: end of file found before the left brace '{' at 'a:\downloads\chili directx framework\assets\game.cpp(45)' was matched
I've seen this error before and it just kinda fixed itself, I don't know what I did to get rid of it lol.
But it's back now.
I've scrounged the forum looking for this error in case it's already been posted but I haven't seen it. I apologize if it's been posted already, but any help would be appreciated. I love these tutorial videos and I'd hate to stop now.
Thanks guys.
It lets me declare it there, but when I repeat it in the Game.cpp file, typing:
void Game::DrawReticle(int x,int y,int r,int g,int b);
{
...Reticle code...
}
I get two errors when I try to compile:
error C2761: 'void Game::DrawReticle(int,int,int,int,int)' : member function redeclaration not allowed
error C2447: '{' : missing function header (old-style formal list?)
The first one goes away if I remove the Game:: before DrawReticle, but the other remains.
The last one is referring to the first '{' following the function.
I'm also getting a
fatal error C1075: end of file found before the left brace '{' at 'a:\downloads\chili directx framework\assets\game.cpp(45)' was matched
I've seen this error before and it just kinda fixed itself, I don't know what I did to get rid of it lol.
But it's back now.
I've scrounged the forum looking for this error in case it's already been posted but I haven't seen it. I apologize if it's been posted already, but any help would be appreciated. I love these tutorial videos and I'd hate to stop now.
Thanks guys.
Re: Lesson 8 Error
You have a semi-colon at the end of the function header.
Code: Select all
void Game::DrawReticle(int,int,int,int,int); <---------HERE
{
//draw code
}
Musi
There are 10 types of people that understand binary.
Those that do, and those that don't.
There are 10 types of people that understand binary.
Those that do, and those that don't.
-
- Posts: 3
- Joined: December 7th, 2012, 5:19 am
Re: Lesson 8 Error
Oh wow, thanks man. I feel really dumb, I can't believe I didn't try that at some point in my trial and error process haha.
Thanks again.
I'm still having that other error:
fatal error C1075: end of file found before the left brace '{' at 'a:\downloads\chili directx framework\assets\game.cpp(45)' was matched
Any help would be appreciated here.
Thanks guys.
Thanks again.
I'm still having that other error:
fatal error C1075: end of file found before the left brace '{' at 'a:\downloads\chili directx framework\assets\game.cpp(45)' was matched
Any help would be appreciated here.
Thanks guys.
Re: Lesson 8 Error
Seems that you are missing a } in the game.cpp.
-
- Posts: 3
- Joined: December 7th, 2012, 5:19 am
Re: Lesson 8 Error
What does that error even mean? It's not making sense to me. And the editor is not showing any obvious red lines or things of that nature like it usually does with syntax errors and things like that.
Re: Lesson 8 Error
It means what i said. You are missing a }.
Re: Lesson 8 Error
It says "End of file found before left brace '{' was matched". So like poschi says, you're most likely missing a closing brace '}' probably at the bottom of Game.cpp
Musi
There are 10 types of people that understand binary.
Those that do, and those that don't.
There are 10 types of people that understand binary.
Those that do, and those that don't.
Re: Lesson 8 Error
Yeah, one thing I would recommend to anyone is google your error codes. You'll often get an answer a lot faster than you would waiting around a forum for some good kind samaritan to take pity on you.
https://www.google.co.jp/#hl=en&sugexp= ... 46&bih=724
Even just the first result I get would probably help you out if you read it.
https://www.google.co.jp/#hl=en&sugexp= ... 46&bih=724
Even just the first result I get would probably help you out if you read it.
Chili