so ive been tryind to create a simple array list class and got stuck allready in the beginning…
my header file ( i deleted my .cpp file and still got the same message )
#ifndef ARRAYLIST_H
#define ARRAYLIST_H
#include <iostream>
using namespace std;
template <typename T>
class ArrayList {
private:
T *arr;
int length;
public:
ArrayList();
void Insert(T item);
void Print();
//friend &ostream operator<< (ostream &out, ArrayList &al);
};
#endif
and my error
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall ArrayList<int>::ArrayList<int>(void)" (??0?$ArrayList@H@@QAE@XZ) referenced in function _main
1>C:\Users\Gannash\Desktop\Programming\C++WS\XMLReader\Debug\XMLReader.exe : fatal error LNK1120: 1 unresolved externals
It is like you only declared methods of the class and not defined them
Put all the definitions in the header