Hello, I am attempting to code a stack structure in C++ using the Dev-C++ compiler. I currently have 3 files: main.cpp, DataStructures.h, and DataStructures.cpp. Every time I attempt to compile it, I get this error: DataStructures.cpp:(.bss+0x0): multiple definition of `node'. I have looked online and tried using extern, adding header guards, editing the makefile, etc. to no avail.
#ifndef DATASTRUCTURES_H
#define DATASTRUCTURES_H
usingnamespace std; //don't using on headers, all that includes it will have it.
struct Node {
int val;
Node* next;
} node; //<-- here
¿do you really want `node' to be a global variable? you don't even use it.