/in/foo.cc:11:3: error: conflicting declaration 'typedef struct Edge Edge'
} Edge;
^~~~
/in/foo.cc:10:12: note: previous declaration as 'struct Edge'
struct Edge* next;
^~~~
/in/foo.cc: In function 'void add_edge(int, int, int)':
/in/foo.cc:22:47: error: invalid application of 'sizeof' to incomplete type 'Edge'
Edge* new_edge = (Edge*)malloc(sizeof(Edge));
^
/in/foo.cc:23:13: error: invalid use of incomplete type 'struct Edge'
new_edge->to = v;
^~
/in/foo.cc:10:12: note: forward declaration of 'struct Edge'
struct Edge* next;
^~~~
/in/foo.cc:24:13: error: invalid use of incomplete type 'struct Edge'
new_edge->length = d;
^~
/in/foo.cc:10:12: note: forward declaration of 'struct Edge'
struct Edge* next;
^~~~
/in/foo.cc:25:13: error: invalid use of incomplete type 'struct Edge'
new_edge->next = graph[u].head;
^~
/in/foo.cc:10:12: note: forward declaration of 'struct Edge'
struct Edge* next;
^~~~
/in/foo.cc: In function 'void dijkstra(int, int)':
/in/foo.cc:53:67: error: invalid use of incomplete type 'struct Edge'
for (Edge* edge = graph[u].head; edge != NULL; edge = edge->next) {
^~
/in/foo.cc:10:12: note: forward declaration of 'struct Edge'
struct Edge* next;
^~~~
/in/foo.cc:54:25: error: invalid use of incomplete type 'struct Edge'
int v = edge->to;
^~
/in/foo.cc:10:12: note: forward declaration of 'struct Edge'
struct Edge* next;
^~~~
/in/foo.cc:55:30: error: invalid use of incomplete type 'struct Edge'
int length = edge->length;
^~
/in/foo.cc:10:12: note: forward declaration of 'struct Edge'
struct Edge* next;
^~~~
/in/foo.cc: In function 'void free_graph(int)':
/in/foo.cc:68:30: error: invalid use of incomplete type 'struct Edge'
current = current->next;
^~
/in/foo.cc:10:12: note: forward declaration of 'struct Edge'
struct Edge* next;
^~~~