Lesson 8 Error

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
Deeppentants
Posts: 3
Joined: December 7th, 2012, 5:19 am

Lesson 8 Error

Post by Deeppentants » December 7th, 2012, 5:31 am

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.

Musi
Posts: 106
Joined: November 25th, 2012, 1:06 am

Re: Lesson 8 Error

Post by Musi » December 7th, 2012, 7:08 am

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.

Deeppentants
Posts: 3
Joined: December 7th, 2012, 5:19 am

Re: Lesson 8 Error

Post by Deeppentants » December 7th, 2012, 12:19 pm

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.

poschi
Posts: 9
Joined: November 28th, 2012, 1:08 am
Location: Germany

Re: Lesson 8 Error

Post by poschi » December 7th, 2012, 12:57 pm

Seems that you are missing a } in the game.cpp. :P

Deeppentants
Posts: 3
Joined: December 7th, 2012, 5:19 am

Re: Lesson 8 Error

Post by Deeppentants » December 7th, 2012, 5:22 pm

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.

poschi
Posts: 9
Joined: November 28th, 2012, 1:08 am
Location: Germany

Re: Lesson 8 Error

Post by poschi » December 7th, 2012, 5:26 pm

It means what i said. You are missing a }.

Musi
Posts: 106
Joined: November 25th, 2012, 1:06 am

Re: Lesson 8 Error

Post by Musi » December 7th, 2012, 7:19 pm

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.

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Lesson 8 Error

Post by chili » December 9th, 2012, 9:10 am

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. :lol:

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

Post Reply