I have a file SpreadSheetCell.h and SpreadSheetCell.cpp.
I have another file SpreadSheet.cpp which includes SpreadSheetCell.h .In this case it is giving me errors like “undefined reference to SpreadSheetCell:SpreadSheetCell()” etc.
But when i try to include SpreadSheetCell.cpp instead the errors are gone. Is it not common to include the header files rather than the cpp files? What can i possibly be doing wrong?
I have a file SpreadSheetCell.h and SpreadSheetCell.cpp. I have another file SpreadSheet.cpp which includes
Share
That is a linking error and means that you are not including a sourcefile that has the definition for
SpreadSheetCell:SpreadSheetCell()when compiling.You are probably missing
SpreadSheetCell.cppin the command line you use, e.g. something like: