build failing due to vector cs2440 - which buildenv?
Hi, I want to have a look at the code but c++ has been a while.
The compilation fails due to some cs2440 in vector. As it is in the depth of the stl, I assume that it is a versioning problem. Can you provide some information on you build environments/ tools, lib versions?
Best Regards
Use Visual Studio 2022 with the provided Code\CrysisMod.sln. The code uses its own older STL version, which is setup in the provided solution. If you are using any other build setup, I'm afraid you are on your own.
Hi, thanks for the reply. I did just that.
An update: I removed any win sdk from the vsinstaller. Now stdlib.h is missing from platform.h. Where do you get the libs from? Do I need some SDK binaries?
I can only asume that vs community does things a bit differently or there is a version switch. However, I had to provide a reference to afxres.h (e.g. G:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\atlmfc\include)
As for the allocation problems, it appears that simply
m_StanceWeponOffsetLeanRight[curStance];
Weapon.cpp, Line 531, will cause the problem.
I'll continue tomorrow
It will build correctly with this diff applied (VS 2022 Community, nothing custom):
diff --git a/Code/CryEngine/CryCommon/VectorMap.h b/Code/CryEngine/CryCommon/VectorMap.h
index e2d2c9a..b913cab 100644
--- a/Code/CryEngine/CryCommon/VectorMap.h
+++ b/Code/CryEngine/CryCommon/VectorMap.h
@@ -56,7 +56,7 @@
//
//--------------------------------------------------------------------------
-template <typename K, typename V, typename T = std::less<K>, typename A = std::allocator<std::pair <const K, V> > >
+template <typename K, typename V, typename T = std::less<K>, typename A = std::allocator<std::pair <K, V> > >
class VectorMap : private T // Empty base optimization
{
public:
I can only asume that vs community does things a bit differently or there is a version switch. However, I had to provide a reference to afxres.h (e.g. G:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\atlmfc\include)
If someone has this problem and doesn't have the afxres.h file on the disc, you need to go to VS Installer, go to specific packages section, search for C++ MFC and get the one for your current version and for x86/64.
Created PR to address this issue. Please re-test it on your own (I assume older?) MSVC if it still works for you. I successfully built it with v143.