I got this problem now when I`m on lesson 8 from the beginner tutorials. So I do everything correctly and on the last step( Draw the game over thing) when I try to build the solution I get this error:
1>..\Assets\Game.cpp(24): error C2533: 'Game::{ctor}' : constructors not allowed a return type
Here are my lines 23, 24 and 25:
Game::Game( HWND hWnd,const KeyboardServer& kServer )
: gfx ( hWnd ),
kbd( kServer ),
Anyone has an idea where is the bug ?
Problem with constructor
Re: Problem with constructor
There is not enough code there to say anything post your whole game .cpp and game .h or just post your soultion.
Computer too slow? Consider running a VM on your toaster.
- npissoawsome
- Posts: 114
- Joined: June 8th, 2012, 3:01 pm
Re: Problem with constructor
get rid of the comma after kbd( kServer )corvo wrote:I got this problem now when I`m on lesson 8 from the beginner tutorials. So I do everything correctly and on the last step( Draw the game over thing) when I try to build the solution I get this error:
1>..\Assets\Game.cpp(24): error C2533: 'Game::{ctor}' : constructors not allowed a return type
Here are my lines 23, 24 and 25:
Game::Game( HWND hWnd,const KeyboardServer& kServer )
: gfx ( hWnd ),
kbd( kServer ),
Anyone has an idea where is the bug ?
Re: Problem with constructor
Here is the code and thank you for your attention but the bug is not in the comma.
- Attachments
-
- zippedcode.rar
- (38.62 KiB) Downloaded 146 times
Re: Problem with constructor
Go to Game.h and put a semicolon at the very end of the class definition. Never ever forget or delete those because they create build errors that are hard to diagnose.
Chili