VS2013 Unresolved External with constructor and destructor

172 views Asked by At

I am trying to make a linked list program that will add two polynomials together, pretty simple. However, whenever I try and build this program, I get an unresolved external error. The exact error is as follows:

1>PG150_33_main.obj : error LNK2019: unresolved external symbol "public: __thiscall Poly::Poly(void)" (??0Poly@@QAE@XZ) referenced in function _main
1>PG150_33_main.obj : error LNK2019: unresolved external symbol "public: __thiscall Poly::~Poly(void)" (??1Poly@@QAE@XZ) referenced in function _main
1>C:\Users\****\Documents\Visual Studio 2013\Projects\PG150_33_polys.cpp\Debug\PG150_33_polys.cpp.exe : fatal error LNK1120: 2 unresolved externals

I have never had this issue before, and I am able to build and compile other multi-file projects in VS without any issues so I don't think it is something in my linker or environment settings. The problem only occurs once I try and create an instance of the object in main, building the project without trying to create the object will not throw any errors.

If needed I can post the contents of the files when requested. I have tried researching this issue and the closest I could find was something to do with a virtual constructor/destructor which is unrelated to what I'm getting.

Thanks for all help in advance!

Edit: Yes I have seen the page that was linked and marked as duplicate. It doesn't cover my error. It also only covers issues with virtual destructors, or other methods of linking. I don't use virtual destructors at all, and while the error I get is similar, it is does not solve my issue.

Further Edit: The problem has been solved via an answer below. Simple fix, stupid simple problem.

1

There are 1 answers

1
iplayfast On BEST ANSWER

I suspect that your .h file has the constructor and destructor defined as a prototype, but you never actually implemented them.