Visual Studio 2017 MSVCRT.lib link error Normally something I would follow up on in a Microsoft forum, but thought I'd drop in here first... I had migrated my project from Visual Studio 2010 to Visual Studio 2017 late last year, and everything went smoothly. Just recently, however, I was reviving a testing harness I was using for network code and have been encountering a linker error that is slightly befuddling. Specifically, only in my release builds, I get these: MSVCRT.lib(delete_array.obj) : error LNK2005: "void __cdecl operator delete[](void *)" (??_V@YAXPEAX@Z) already defined in MSVCRT.lib(delete_array.obj) MSVCRT.lib(delete_scalar.obj) : error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPEAX@Z) already defined in MSVCRT.lib(delete_scalar.obj) Now, normally the first stop in MSVCRT linker errors is to check and make sure all the CRT code generation settings are matching across all libs (Multithreaded DLL, etc.). I have meticulously checked ALL settings 6 times over to ensure they match. But then, things are actually a little strange when you consider that in this particular case it's complaining that something in MSVCRT.lib is already defined in...MSVCRT.lib. That's interesting. I do have my own overrides for global new and delete, and commenting out the specific ones noted in the link errors does get things linking error-free. It is worth noting that my overrides are NOT inlined (I guess these days, it's actually not allowed). Further, why it is *only* those two variants (not the std::nothrow_t variants), and only delete (no issues with the overridden new(s)) is a bit perplexing. Even more, I am using said overrides/library in many other projects without this issue (and as noted, this was not an issue in this particular project back in Visual Studio 2010). This smells to me like a Visual Studio 2017 linker issue, but I thought I'd pop in here and see if anyone had seen something similar? https://ift.tt/eA8V8J
Normally something I would follow up on in a Microsoft forum, but thought I'd drop in here first... I had migrated my project from Visual Studio 2010 to Visual Studio 2017 late last year, and everything went smoothly. Just recently, however, I was reviving a testing harness I was using for network code and have been encountering a linker error that is slightly befuddling. Specifically, only in my release builds, I get these: MSVCRT.lib(delete_array.obj) : error LNK2005: "void __cdecl operator delete[](void *)" (??_V@YAXPEAX@Z) already defined in MSVCRT.lib(delete_array.obj) MSVCRT.lib(delete_scalar.obj) : error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPEAX@Z) already defined in MSVCRT.lib(delete_scalar.obj) Now, normally the first stop in MSVCRT linker errors is to check and make sure all the CRT code generation settings are matching across all libs (Multithreaded DLL, etc.). I have meticulously checked ALL settings 6 times over to ensure they match. But then, things are actually a little strange when you consider that in this particular case it's complaining that something in MSVCRT.lib is already defined in...MSVCRT.lib. That's interesting. I do have my own overrides for global new and delete, and commenting out the specific ones noted in the link errors does get things linking error-free. It is worth noting that my overrides are NOT inlined (I guess these days, it's actually not allowed). Further, why it is *only* those two variants (not the std::nothrow_t variants), and only delete (no issues with the overridden new(s)) is a bit perplexing. Even more, I am using said overrides/library in many other projects without this issue (and as noted, this was not an issue in this particular project back in Visual Studio 2010). This smells to me like a Visual Studio 2017 linker issue, but I thought I'd pop in here and see if anyone had seen something similar?
from GameDev.net http://bit.ly/2vdHDxP
from GameDev.net http://bit.ly/2vdHDxP
ليست هناك تعليقات