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 7398209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T03:50:33+00:00 2026-05-29T03:50:33+00:00

I have 4 files, HomeScene.h HomeScene.cpp Options.h Options.cpp both the *.h files have the

  • 0

I have 4 files,

HomeScene.h
HomeScene.cpp
Options.h
Options.cpp

both the *.h files have the other *.h included.
Now I am trying to inherit HomeScene.h in Options.h

class OptionScene : public cocos2d::CCLayerColor,HomeScene

the above line gives so many errors.

class OptionScene : public cocos2d::CCLayerColor

the above line has no errors

I have a static bool var; in my HomeScene.h
which I am trying to use directly in my options scene.

  • 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-05-29T03:50:33+00:00Added an answer on May 29, 2026 at 3:50 am

    Why do you need to include Options.h in HomeScene.h ? If OptionScene is the type derived from HomeScene, then I don’t know why would you need to do that.

    In case you just need to declare pointer / reference to the type declared in Options.h, you could use forward declaration.

    Options.h

    #include "HomeScene.h"
    class OptionScene
    {
        // ...
    };
    

    HomeScene.h

    class OptionScene; // forward declaration
    
    class HomeScene
    {
        OptionScene* o;
    };
    

    If this is your problem, then this question will help you: When can I use a forward declaration?

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

Sidebar

Related Questions

Suppose I have files a.cpp and b.cpp and I get warnings in a.cpp and
I have files which contain file names pointing to other files. These files contain
Lets say I have files: Libs: one.cpp, one.h two.cpp, two.h three.cpp, three.h Program: program.cpp
my problem is too complex now i have files table I selected from it
I have files that are versioned, using a major and minor version. Now what
I have files served like so: AJAX request handler -> Include file I would
I have files which have many empty cells which appear as NaNs when I
I am constantly noticing that I have files checked out for editing that I
In my Visual Studio 2010 project I have files with .mm file extension, that
I have a problem in giving Ajax functionality to a hyperlink. I have files

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.