linker command failed with exit code 1
I have been creating a Map class for creating allocated 2d Array. When I tried to Complier the file there is linker command failed to show up. Can anyone could help me figure out? here is my Cpp file #include<iostream> #include "Map.hpp" Map::Map() { // arr=nullptr; Map::setMapWidth(0); Map::setMapHeight(0); } Map::Map(int y,int x) { mapHeight=y; mapWidth=x; arr = new int*[y]; for(int i = 0; i < y; ++i) { arr[i] = new int[x]; } } Map::~Map() { for(int i = 0; i < mapHeight; ++i) { delete [] arr[i]; } delete [] arr; } Here is my Header file #ifndef Map_hpp #define Map_hpp #include<string> #include<stdio.h> class Map{ private: int mapWidth; int mapHeight; int **arr; public: Map(); Map(int width,int height); ~Map(); void setMapWidth(int width); void setMapHeight(int height); int getMapWidth(){return mapWidth;} int getMapHeight(){return mapHeight;} }; #endif /* Map_hpp */