"Error 1 error LNK2005:" public: __thiscall std :: _ Container_base12 :: ~ _Container_base12 (void) "(?? 1_Container_base12 @std @@ QAE @XZ), already defined in foo.lib (foo.obj) C: \ foo \ msvcprtd.lib (MSVCP100D.dll) footest "
From what I see, this error message means that you turn on the MSVC environment library twice. This may be due to the result of compiling foo.lib using the Runtime library: Multi-threaded (/ MT) and a test project with the option: for example, a multi-threaded DLL (/ MD).
Check the execution parameters in Project Properties / C / C ++ / Code Generation for both projects and make sure they are the same for both projects.
source share