This error is annoying, Im kinda new to this design please help:
error C2061: syntax error : identifier 'GameObject'
InputComponent::Update' : function does not take 1 arguments
error C2259: 'PlayerInputComponent' : cannot instantiate abstract class
1> due to following members:
1> 'void InputComponent::Update(void)' : is abstract
InputComponent:
1 2 3 4 5 6 7
#pragma once
#include "GameObject.h"
class InputComponent
{
public:
virtualvoid Update(GameObject &obj) = 0;
};
PlayerInputComponent:
1 2 3 4 5 6 7 8 9 10 11 12
#pragma once
#include "InputComponent.h"
#include "GameObject.h"
class PlayerInputComponent : public InputComponent
{
public:
virtualvoid Update(GameObject &obj)
{
//Check input here..
}
private:
};
Thanks for the help but im still confused, I dont know where i am going wrong, i have done the includes and im still getting the '+1 overloaded' error.
Also what is wrong with the way im declaring a new GameObject ne555?
The game objects takes a component when created so im confused, also im dynamically allocating it because i want to manually handle it?
Sorry, this question -> im still getting the '+1 overloaded' error.
tfityo suggested a design i was implementing that works, whenever i put it into classes (see the beginning of my post for it) it throws a few error for me.
I have solved most of the errors by forward declaring some classes inside others. Now the only problem im getting is the '+1 overloaded'. This is something im getting when i declare an object like this:
GameObject *Player = new GameObject(new PlayInputComponent);
However the program runs fine but i get this error anyways. Im just trying to figure out the cause of this problem and if theres any other creation of the object
I appreciate your help and i hope your not getting frustrated(at least as i am lol) but the build isnt actually giving me the error, when i hold my mouse over the line where i dynamically create the object, it displays the error or warning
EDIT:
Also Cire, when i do EXACTLY that code and put it into classes, i get a '+2 overload' error when i hold my mouse over GameObject that i created, dynamically created or not.. im so confused -_-