Dec 7, 2013 at 8:12am UTC
Ok so in my program i have all my headers in main, and I have my constructors in seperate files and for some reason it keeps telling me this
error: expected initializer before 'Game'|
||=== Build finished: 1 errors, 0 warnings (0 minutes, 0 seconds) ===|
Game is the constructor in its own .h file and it keeps saying that, why does it do that? why does the order matter? i never seen that before, i would have never thought that to be a problem, now here are my headers
#include <iostream>
#include <string>
#include <vector>
#include <limits>
#include <fstream>
#include <windows.h>
#include "Pet_Class.h"
#include "Player_Class.h"
#include "Game_Class.h"
#include "Prototypes.h"
#include "GameClass_Constructor.h"
#include "PlayerClass_Constructor.h"
#include "PetClass_Constructor.h"
My code is too big for this post so if you need to see it then let me know and ill put it up on pastebin or something.
Last edited on Dec 7, 2013 at 8:13am UTC
Dec 7, 2013 at 9:03am UTC
A shot in the dark: There's a semicolon or some other punctuation missing just before the constructor declaration.