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

  • SEARCH
  • Home
  • 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 7969987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:19:32+00:00 2026-06-04T07:19:32+00:00

I have Environment.h file: #include <windows.h> #include interfaces.h #ifndef ENVIRONMENT_H #define ENVIRONMENT_H class Environment

  • 0

I have Environment.h file:

#include <windows.h>
#include "interfaces.h"

#ifndef ENVIRONMENT_H
#define ENVIRONMENT_H

class Environment {};
#endif

and i have Interfaces.h file:

#ifndef INTERFACES_H
#define INTERFACES_H

class IMoving {
    public: 
        virtual void Move() = 0;          
};

#endif

in interface IMoving i would like to get an Environment class, to know how to move

class IMoving {
    public: 
        virtual void Move(Environment*) = 0;          
};

if i want to do this i need to include environment.h

#include "Environment.h"

and here i’m getting an error, becouse Environment.h – includes Interfaces.h and Interfaces.h – includes Environtment.h. So how to make it work ?

Sorry for spelling mistakes

  • 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-04T07:19:33+00:00Added an answer on June 4, 2026 at 7:19 am

    For circular dependencies one can use Forward declaration(s)

    In Interfaces.h just above interface definition, forward declare Environment as follows:

    class Environment;
    

    Then when you implement IMoving in a class, you will include Environment.h in its implementation (cpp) file.

    You can read more about Forward declaration here.

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

Sidebar

Related Questions

I have a script code in vb.net environment which is calling file from path
Actually I have a file . I am working in linux environment. I need
For an ASP.Net environment what permissions should the logging file created by NLog have
Can the TFS proxy be installed on Windows XP? I have an environment that
My compile environment is windows xp and vc 6.0. Now I have a c
I have an SConstruct file for scons: env = Environment() env.Append(CPPPATH = ['./']) env.Append(LIBS
Is it possible for the apache2 user, http, to have environment variables like normal
I have an environment where 2 load-balanced clustered tomcats pointing to same application. When
At my company, we have tiered environment for our web applications (development, staging, production).
I have a support environment where we connect to many of our customers' systems

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.