Bind errors when trying to compile old STD and Windows SDK libraries

I have an old project that compiles in VS2005 (Sadly). It must remain in VS2005 so that it can properly bind to another process that has VS2005 CRT, MFC, etc.

Now I need to compile this project in VS2015 using the old VS2005 toolkit.
I changed the directories of the VC ++ project to the old folders for all the headers and libraries of the STD and Windows SDK (include directories, reference directories, library directories, source directories).

This trick used to work fine while working with VS2010, but on VS2015 I get some weird link errors:

1>Project1.obj : error LNK2019: unresolved external symbol "void __stdcall `eh vector destructor iterator'(void *,unsigned int,unsigned int,void (__thiscall*)(void *))" ( ??_M@YGXPAXIIP6EX0 @ Z@Z ) referenced in function "public: virtual void * __thiscall PluginInterface::`vector deleting destructor'(unsigned int)" ( ??_EPluginInterface@ @ UAEPAXI@Z ) 1> 1> 1>StdAfx.obj : error LNK2001: unresolved external symbol "void __stdcall `eh vector destructor iterator'(void *,unsigned int,unsigned int,void (__thiscall*)(void *))" ( ??_M@YGXPAXIIP6EX0 @ Z@Z ) 1> 1> 1>Project1.obj : error LNK2019: unresolved external symbol "void __cdecl operator delete(void *,unsigned int)" ( ??3@YAXPAXI @Z) referenced in function __unwindfunclet$?getInstance@Project1 @@ SAPAV1@XZ $0 1> 1> 1>Project1.obj : error LNK2019: unresolved external symbol "void __cdecl operator delete[](void *,unsigned int)" ( ??_V@YAXPAXI @Z) referenced in function "public: virtual void * __thiscall PluginInterface::`vector deleting destructor'(unsigned int)" ( ??_EPluginInterface@ @ UAEPAXI@Z ) 

Why is he looking for this internal deleter implementation? Should it be implemented from the headers? Why will it work in VS2010 and not VS2015?

How can I fix it right?

+5
source share
1 answer

So, after reading a large number of changes in the change documents, I found a flag that can suppress these new C ++ 14 delete implementations here , under Place new and delete .

Adding the / Zc: sizeDealloc flag - removes missing implementations of delete (). Project Properties → Configuration Properties → C / C ++ → Command Prompt → / Zc: sizeDealloc -

you can revert to the old behavior using the / Zc: sizedDealloc - compiler option. If you use this option, remove two function arguments that do not exist and will not cause a conflict with your delete location.

For the eh vector destructor iterator error, I opened a separate question and answered it .

+1
source

Source: https://habr.com/ru/post/1269331/


All Articles