1

I am very confused about the occurring error. Others had the same problem but I am not sure how to solve this in my case. I share some of the code:

Node.h:

#ifndef STHG_NODE_H
#define STHG_NODE_H

#include <stdint.h>
#include <vector>
#include "NodeType.h"
#include "Edge.h"

class Node {
 public:
  Node(const uint32_t id);
  ~Node();
  uint32_t getID() const;
  void addOutgoingEdge(Edge *e);

 private:
  uint32_t id;
  std::vector<Edge*> outgoingEdges;
};
#endif //STHG_NODE_H

Edge.h:

#ifndef STHG_EDGE_H
#define STHG_EDGE_H

#include "Node.h"

class Edge {
 public:
  Edge(Node *first, Node *second);
  ~Edge();

 private:
  UCNode *first;
  UCNode *second;
};
#endif //STHG_EDGE_H

The error is the following one:

Edge.h:12:15: error: expected ')' before '*' token
   Edge(Node *first, Node *second);

I want to understand why this error occurs and how to prevent it in the future.

Zody
  • 19
  • 2

0 Answers0