My project works and compiles properly in Visual Studio 2012. However Im trying to open it in a computer with VS 2015 and I get 156 errors. All the same and all in the same file and same 3 lines: Severity Code Description Project File Line Suppression State
Error C2338 The C++ Standard forbids containers of const elements because allocator<const T> is ill-formed. leaf c:\program files (x86)\microsoft visual studio 14.0\vc\include\xmemory0 585
Error C2535 'const long *std::allocator<_Ty>::address(const long &) noexcept const': member function already defined or declared leaf c:\program files (x86)\microsoft visual studio 14.0\vc\include\xmemory0 613
Error C2535 'const long *std::_Wrap_alloc<std::allocator<_Ty>>::address(const long &) const': member function already defined or declared leaf c:\program files (x86)\microsoft visual studio 14.0\vc\include\xmemory0 846
I just get those same 3 errors 52 times each for a total of 156. Not a single error comes from my code, all are this xmemory0 file.
I assume you're trying to use an STL container with const
s? This is prohibited by C++ standard, but an earlier version of Visual C++ allowed this. The new compiler is more standard compliant in this and will produce an error just like yours.
More information at Visual Studio Connect
Might be possible to do a simple Find in Files for "<const" to check if there's anything like that in the whole source code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With