I'm using MVS 2013 and I wrote struct in file ListStruct.h. During linking I'm getting error LNK2005:
error LNK2005: "public: __thiscall ListStruct::ListStruct(void)" (??0ListStruct@@QAE@XZ) already defined in projekt1.obj
Now - part of ListStruct.h
#ifndef _LISTSTRUCT_H_
#define _LISTSTRUCT_H_
#include "stdafx.h"
struct ListStruct{
Member *head; //wskaznik na poczatek listy
Member *tail; //wskaznik na koniec listy
void AddMember(int value);
void RemoveMember(int value);
void Display();
ListStruct();
};
#endif
Part of my main:
#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
ListStruct *base = new ListStruct;
system("pause");
return 0;
}
What am I doing wrong? Do I have to create ListStruct.cpp file? How it supposed to look like?