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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:19:20+00:00 2026-05-18T04:19:20+00:00

I cannot for the heck of it find why this is throwing an error!

  • 0

I cannot for the heck of it find why this is throwing an error! Okay so I have a Struct that contains some objects. I then create a pointer to that struct and set the items one by one. By I keep getting an error. Here’s the code:

Robot.h:

// Name and Animation info
std::map<std::string, Ogre::AnimationState*> mAnims2;

struct Animation {
    std::string name;   // The name of the animation state
    Ogre::AnimationState* mAnimState;   // The actual animation state
    bool FADE_IN;       // Fade the animation in
    bool FADE_OUT;      // Fade the animation out
};

Robot.cpp:

    // Go through the set by using iterator
while (animStateIter.hasMoreElements()) {
    // The Animation object we will construct
    Animation* mAnimation = new Animation();
    // Initial values for Fading In and Out
    mAnimation->FADE_IN = false;    
    mAnimation->FADE_OUT = false;   
    // Create the Animation object, using the next animation in the list
    mAnimation->mAnimState = animStateIter.getNext();
    // Set the animations name
    mAnimation->name = Animation->mAnimState->getAnimationName();
    // Make sure the animation is set to Loop
    mAnimation->mAnimState->setLoop( true );
    // Insert the Animation object into the list of Animations
    mAnims2.insert( std::make_pair( mAnimation->name, mAnimation) );
    /* DEBUG */
    output << mAnimation->name << std::endl;
}

The Error:

Error 1 error C2819: type 'Robot::Animation' does not have an overloaded member 'operator ->' c:\users\masry\school-work\fall-2010\cs-425\homework-4\gameengine_solution\robot.cpp 52

Also if you noticed, I am trying to dynamically create Struct objects and insert them into a Map. I call:

Animation* mAnimation = new Animation();

in a while loop, is this good OO design? If not, what is a better way? Thank you.

EDIT:
So, thanks to Frédéric, it turned out that I was missing a letter. but now I am getting an error saying:

Error   17  error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,unsigned char)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::string'    c:\users\masry\school-work\fall-2010\cs-425\homework-4\gameengine_solution\robot.cpp    58
  • 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-18T04:19:20+00:00Added an answer on May 18, 2026 at 4:19 am

    I think your error is there:

    // Set the animations name
    mAnimation->name = Animation->mAnimState->getAnimationName();
    

    That probably should be:

    // Set the animations name
    mAnimation->name = mAnimation->mAnimState->getAnimationName();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need help with a pretty basic Postgres command, but I cannot find a
I have a weird problem where I cannot run aapt from an sbt command
For the life of me I cannot figure out why I can’t get this
This is a super naive question (I know), but I think that it will
I created a ListView with a custom layout for each view. I have several
I'm trying to DRY out some lambda expressions for security rights. Is it possible
After doing some thorough web browsing, I've seen two methods for serializing stuff in
Cannot figure out how to get access to the extended properties of a child
A few years back, another clever programmer set up a VB.NET service to print

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.