Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9163455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:27:07+00:00 2026-06-17T14:27:07+00:00

I have a big game engine to compile and it worked fine until I

  • 0

I have a big game engine to compile and it worked fine until I did some crazy adjustments. The compiler somehow cannot reconize my mean Game object and produce error C2061: syntax error : identifier 'Game', and it seems no matter what file I compile the error always points to a file called GameDataLoader.h even there is absolutely no connection with this two files. Usually I think it is an inclusion problem but the fact is I have Game.h included in every .h file necessary, right after the inclusion of stdafx.h and I have #pragama once on top of it. I thought about circular inclusion problem but the #pragma once should take care of that. Plus this inclusion directives works fine until I changed some file name and other messy stuff. I cleaned the entire solution and tried to rebuild it but still no luck (using VS2012).
I don’t know if showing the code will help, but here is the code for gameDataLoader.h. This isn’t a file I wrote but it should work properly.

#pragma once
#include "stdafx.h"
#include "Game\Game.h" // Game.h included

class GameDataLoader
{
public:
    GameDataLoader(){} 
    ~GameDataLoader(){}

void GameDataLoader::loadGameProperties( Game *game, map<wstring, wstring> *properties, wstring gameInitFile);

    virtual void loadGame(Game *game, wstring gameInitFile) = 0;
    virtual void loadGUI(Game *game, wstring guiInitFile) = 0;
    virtual void loadWorld(Game *game, wstring levelInitFile) = 0;
};

And I had errors exactly on those 4 lines with Game object. What could possibly be the problem?
Double inclusion? Circular inclusion? Or did not include something and somewhere else?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T14:27:09+00:00Added an answer on June 17, 2026 at 2:27 pm

    Most likely, Game.h is including GameDataLoader.h, either directly or indirectly, creating a circular dependency; but you forgot to show us Game.h, so I can’t be sure of that.

    If that is the case, then #pragma once (or the equivalent include guard) will mean that one of the headers will be included before the other, and declarations from the second won’t be available to the first. It won’t magically include both of them before each other, since that is impossible.

    Luckily, GameDataLoader.h doesn’t need the full definition of Game, since it only deals with pointers to it. So you can remove the inclusion of Game.h and just declare class Game; instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have thought of some heuristics for a big (higher dimensions) tic-tac-toe game. How
I have a big 3d game that lets players build and create interesting and
I have a game with a big raster map Now we are using jpeg
I am developing a browser based game, and I have a big map there.
I have a game tree that is too big to walk in its entirety.
I'm working on a fairly big open source RTS game engine ( Spring ).
There is something I have never understood. How can a great big PC game
In my isometric flash game I have some models with long shadows. I want
Lately I have been playing a game on my iPhone called Scramble. Some of
Here is the link to the site: War game map I have a big

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.