c++visual-studiodlldevelopment-environment

Unresolved external symbol in library in C++


I am trying to compile un software which is written in C++ at visual studio 2017,but I face un problem in the library. The description is like this.

Severity    Code    Description Project File    Line    Suppression State
Error   LNK2001 unresolved external symbol "public: virtual void __thiscall CEZOptionsDlg::AddButton(class ATL::CStringT<char,class StrTraitMFC_DLL<char,class ATL::ChTraitsCRT<char> > >,unsigned int)" (?AddButton@CEZOptionsDlg@@UAEXV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@I@Z)

I have already included the path of library in the "VC++ directories" and added the *.lib in "Additional library directories". The setting is in the mode "Debug" , "x86".

I have tried to change the setting in "Runtime library" but it doesn't work. I have tried to change the "calling convention", but it doesn't work ,too.

Because it is a software who is written a bit long ago, I doubt that is it possible that the problem is on the x86 and x32. But in the "configuration manager", it runs at platform win32. It shouldn't be wrong.

I also doubt it might be the problem in the .dll, but I just compile the software. It should only be related to .lib

I don't know if the *.lib is complete because I don't have source code of this library.

I have been trapped in the problem for 2 days. Can anyone come and help me.


Solution

  • I finally found out it is caused by a very old version of de Visuel C++(VS 98), who is probably the same age as I am. After I used the VS98 in Visuel Stdio 2017( which sound ridiculous ), the code can build correctly. I think this problem may only be occured to me. But, anyway, I hope this solution will help others.