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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:12:00+00:00 2026-05-26T20:12:00+00:00

So I am getting the following errors: ..\Actor.h:35: error: `Attack’ is not a member

  • 0

So I am getting the following errors:

..\Actor.h:35: error: `Attack' is not a member of `RadiantFlux'
..\Actor.h:35: error: template argument 1 is invalid
..\Actor.h:35: error: template argument 2 is invalid
..\Actor.h:35: error: ISO C++ forbids declaration of `attacks' with no type

On this line (among others):

std::vector<RadiantFlux::Attack> attacks;

Here are the relevant files:

Actor.h:

#ifndef ACTOR_H_
#define ACTOR_H_

#include <string>
#include <vector>
#include "Attack.h"

namespace RadiantFlux {

...

class Actor {
private:
    std::string name;
    int health;
    std::vector<RadiantFlux::Attack> attacks;
    Attributes attributes;

public:
    ...
};

}

#endif /* ACTOR_H_ */

Attack.h:

#ifndef ATTACK_H_
#define ATTACK_H_

#include <string>
#include <stdlib.h>
#include <time.h>
#include "Actor.h"

namespace RadiantFlux {

... 

class Attack {
private:
    ...

public:
    ...
};

}

#endif /* ATTACK_H_ */

Why am I getting these errors and what can I do to fix them? I am assuming it has something to do with the namespaces…

  • 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-26T20:12:00+00:00Added an answer on May 26, 2026 at 8:12 pm

    You have a cyclic dependency of your header files.
    Attack.h includes Actor.h and vice versa.
    Use Forward Declaration of class to avoid circular dependency problems.


    Since the OP’s comments, here is what needs to be done:

    class Actor;
    
    class Attack
    {
    
    };
    

    If your code fails to compile after doing this, You need to read the linked answer and Understand why the error and how to solve it. The linked answer explains it all.

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

Sidebar

Related Questions

I'm getting the following errors in Git using BitBucket: conq: repository does not exist.
I am getting the following errors while parsing css file all.css null [1:1763] Error
When am trying to set default date and default sysdate am getting following errors:
While validating my CSS on http://jigsaw.w3.org/css-validator/ I am getting following errors: 1.Property zoom doesn't
I am getting the following errors: PHP Warning: Module 'ldap' already loaded in Unknown
When compiling my wxWidget HelloWorld application, I am getting the following errors: Warning 1
On several of my adsense running sites, I have been getting the following errors:
Am getting following error message on calling WCF service: The formatter threw an exception
I am getting following error when I am trying to get WebResponse using WebResponse
I am getting following error message when using Doctrine ORM in Codeigniter. ( !

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.