Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I get these errors when I try to compile my program, but I have included my head

ID: 441883 • Letter: I

Question

I get these errors when I try to compile my program, but I have included my header statement in my main file so I do not understand the reason why I keep getting these errors. Does anyone have any ideas on what to do? 1>TopicB.obj : error LNK2019: unresolved external symbol "public: bool __thiscall Complex::isLess(class Complex)const " (?isLess@Complex@@QBE_NV1@@Z) referenced in function _main 1>TopicB.obj : error LNK2019: unresolved external symbol "public: void __thiscall Complex::divide(class Complex,class Complex &)" (?divide@Complex@@QAEXV1@AAV1@@Z) referenced in function _main 1>TopicB.obj : error LNK2019: unresolved external symbol "public: void __thiscall Complex::multiply(class Complex,class Complex &)" (?multiply@Complex@@QAEXV1@AAV1@@Z) referenced in function _main 1>TopicB.obj : error LNK2019: unresolved external symbol "public: void __thiscall Complex::subtract(class Complex,class Complex &)" (?subtract@Complex@@QAEXV1@AAV1@@Z) referenced in function _main 1>TopicB.obj : error LNK2019: unresolved external symbol "public: void __thiscall Complex::add(class Complex,class Complex &)" (?add@Complex@@QAEXV1@AAV1@@Z) referenced in function _main 1>TopicB.obj : error LNK2019: unresolved external symbol "public: __thiscall Complex::Complex(void)" (??0Complex@@QAE@XZ) referenced in function _main 1>TopicB.obj : error LNK2019: unresolved external symbol "public: void __thiscall Complex::display(void)const " (?display@Complex@@QBEXXZ) referenced in function _main 1>TopicB.obj : error LNK2019: unresolved external symbol "public: __thiscall Complex::Complex(double,double)" (??0Complex@@QAE@NN@Z) referenced in function _main

Explanation / Answer

Most probable reasons of the errors: just verify which one of these your program in having:
A) you cannot have a companion .cpp file when creating templates...............
all declarations and defintitions must be in the header file.............
B) The header file should declare the functions with the "public" keyword.
C)the compiler cannot find a template function ,get some pre tested templates.
D) The most probable cause: .......
The .lib is not included in your project. Make sure you are linking it in; Configuration Properties -> Linker -> Input -> Additional Dependencies ............
Another altnerative is to simply copy the .lib to your project folder but don't, it's bound to create problems later on. ...........
Sometimes the .lib is not shipped with the library, so you need to compile it yourself. The README will tell you this. If this is the case, they usually ship with a .sln file you can open and the just compile it into a .lib file which you then reference in your main application, as I wrote above
E) you add the path of header files in the "Configuration Properties" --> "C/C++