I have two classes Node
and Wire
. I am getting an error for the line vector<Wire*> inputs;
Node.h
#ifndef NODE_H_
#define NODE_H_
#include "wire.h"
class Node{
private:
bool sorted;
TGate gateType;
string name;
vector<Wire*> inputs;
vector<Wire*> outputs;
int state;
}
#endif /* NODE_H_ */
Wire.h
#ifndef WIRE_H_
#define WIRE_H_
#include "Node.h"
class Node;
class Wire{
private:
Node* input;
Node* output;
public:
Wire(Node* a, Node* b);
//void setInput(Node* in);
//void setOutput(Node* out);
Node* getInput();
Node* getOutput();
};
#endif /* WIRE_H_ */
wire.cpp
#include "wire.h"
#include"node.h"
class Node;
Wire::Wire(Node* a, Node* b)
{
}
node.cpp
Node::Node(TGate gT, string name)
{
std::cout<<"\nNode created is: "<<name<<"\n";
}
ERROR: /src/node.h:29:9: error: ‘Wire’ was not declared in this scope