Hi,
I've been trying to compile ogredeps on windows, so that I can compile ogre v2-3 branch, I use vs 2022 (tried combined with 2017 compiler as well), but I end up with this error:
FreeImage.vcxproj -> E:\temp\Ogre\solution\Dependencies\src\FreeImage\Release\FreeImage.lib
OgrePrecompiledHeaders.cpp
E:\temp\Ogre\source\ogre\OgreMain\include\OgreString.h(226,21): error C2039: 'hash_compare': is not a member of 'stdext' [E:\temp\Ogre\solution\OgreMain\OgreMain.vcxproj]
(compiling source file '../../source/ogre/OgreMain/src/OgrePrecompiledHeaders.cpp')
C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.44.35207\include\iterator(1481,1):
see declaration of 'stdext'
E:\temp\Ogre\source\ogre\OgreMain\include\OgreString.h(226,33): error C2143: syntax error: missing ';' before '<' [E:\temp\Ogre\solution\OgreMain\OgreMain.vcxproj]
(compiling source file '../../source/ogre/OgreMain/src/OgrePrecompiledHeaders.cpp')
E:\temp\Ogre\source\ogre\OgreMain\include\OgreString.h(226,21): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [E:\temp\Ogre\solution\OgreMain
\OgreMain.vcxproj]
(compiling source file '../../source/ogre/OgreMain/src/OgrePrecompiledHeaders.cpp')
Has anyone of you compiled ogredeps recently on windows?
Last edited by hedphelym on Sun Oct 26, 2025 9:22 am, edited 2 times in total.
I built ogre from master branch (4.0) few weeks ago with msvc2022 x64 using modified scripts from https://www.ogre3d.org/download/sdk/sdk-ogre-next (there is no msvc2022 script so best starting point is to change generator in build_ogre_Visual_Studio_16_2019_x64.bat to "Visual Studio 17 2022").
CMake Error at CMakeLists.txt:5 (cmake_minimum_required):
Compatibility with CMake < 3.5 has been removed from CMake.
Update the VERSION argument <min> value. Or, use the <min>...<max> syntax
to tell CMake that the project requires at least <min> but has been updated
to work with policies introduced by <max> or earlier.
Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.
-- Configuring incomplete, errors occurred!
which required changing in ogre-next-deps\src\SDL2\CMakeLists.txt
Okay, thanks again for the feedback, I have my own build script, that pulls the sources and triggers cmake and all that.
I set it to use VS 2022 - with 2017 compiler.
Good to know that you get it to compile.
Dependencies\src\FreeImage\Source\FreeImage\ToneMapping.cpp(83): error C2440: 'static_cast': c
annot convert from 'double' to 'FREE_IMAGE_CVT_COLOR_PARAM' [E:\temp\Ogre\source\ogre\Dependencies\build\src\FreeImage\
FreeImage.vcxproj]
basically what I do is clone the dependencies, make a build folder, go into that, and call:
?
It specify (according to quick search with man cmake and what v141 means) compatibility with Visual Studio 2017.
Try to build it without this parameter.
I have tried without that parameter as well.
The reason why I have it this way is because we use VS2022 editor, but have our codebase set to 2017 compiler.
I now tested without that parameter, just set it to vs2022 and use native compiler.
I still end up with this problem:
FreeImage.vcxproj -> E:\temp\Ogre\solution\Dependencies\src\FreeImage\Release\FreeImage.lib
OgrePrecompiledHeaders.cpp
E:\temp\Ogre\source\ogre\OgreMain\include\OgreString.h(226,21): error C2039: 'hash_compare': is not a member of 'stdext
' [E:\temp\Ogre\solution\OgreMain\OgreMain.vcxproj]
(compiling source file '../../source/ogre/OgreMain/src/OgrePrecompiledHeaders.cpp')
C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.44.35207\include\iterator(1481,1):
see declaration of 'stdext'
E:\temp\Ogre\source\ogre\OgreMain\include\OgreString.h(226,33): error C2143: syntax error: missing ';' before '<' [E:\t
emp\Ogre\solution\OgreMain\OgreMain.vcxproj]
(compiling source file '../../source/ogre/OgreMain/src/OgrePrecompiledHeaders.cpp')
E:\temp\Ogre\source\ogre\OgreMain\include\OgreString.h(226,21): error C4430: missing type specifier - int assumed. Note
: C++ does not support default-int [E:\temp\Ogre\solution\OgreMain\OgreMain.vcxproj]
(compiling source file '../../source/ogre/OgreMain/src/OgrePrecompiledHeaders.cpp')
So the problem occurs when compiling the ogrev2-3 branch, not when compiling the dependencies.
Dependencies\src\FreeImage\Source\FreeImage\ToneMapping.cpp(83): error C2440: 'static_cast': c
annot convert from 'double' to 'FREE_IMAGE_CVT_COLOR_PARAM' [E:\temp\Ogre\source\ogre\Dependencies\build\src\FreeImage\
FreeImage.vcxproj]
I got the same error along with OpenEXR when I tried build dependencies with msvc2015 x86 few weeks ago.
OgrePrecompiledHeaders.cpp
D:\Libraries\Ogre\test\Ogre\ogre-next\OgreMain\include\OgreString.h(226,21): error C2039: 'hash_compare': is not a memb
er of 'stdext' [D:\Libraries\Ogre\test\Ogre\ogre-next\build\OgreMain\OgreMain.vcxproj]
(compiling source file '../../OgreMain/src/OgrePrecompiledHeaders.cpp')
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.44.35207\include\iterator(1481,1)
:
see declaration of 'stdext'
D:\Libraries\Ogre\test\Ogre\ogre-next\OgreMain\include\OgreString.h(226,33): error C2143: syntax error: missing ';' bef
ore '<' [D:\Libraries\Ogre\test\Ogre\ogre-next\build\OgreMain\OgreMain.vcxproj]
(compiling source file '../../OgreMain/src/OgrePrecompiledHeaders.cpp')
D:\Libraries\Ogre\test\Ogre\ogre-next\OgreMain\include\OgreString.h(226,21): error C4430: missing type specifier - int
assumed. Note: C++ does not support default-int [D:\Libraries\Ogre\test\Ogre\ogre-next\build\OgreMain\OgreMain.vcxproj]
(compiling source file '../../OgreMain/src/OgrePrecompiledHeaders.cpp')
Wersja programu MSBuild 17.14.23+b0019275e dla .NET Framework
OgrePrecompiledHeaders.cpp
D:\Libraries\Ogre\test\Ogre\ogre-next\OgreMain\include\OgreString.h(226,21): error C2039: 'hash_compare': is not a memb
er of 'stdext' [D:\Libraries\Ogre\test\Ogre\ogre-next\build\OgreMain\OgreMain.vcxproj]
(compiling source file '../../OgreMain/src/OgrePrecompiledHeaders.cpp')
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.44.35207\include\iterator(1481,1)
:
see declaration of 'stdext'
D:\Libraries\Ogre\test\Ogre\ogre-next\OgreMain\include\OgreString.h(226,33): error C2143: syntax error: missing ';' bef
ore '<' [D:\Libraries\Ogre\test\Ogre\ogre-next\build\OgreMain\OgreMain.vcxproj]
(compiling source file '../../OgreMain/src/OgrePrecompiledHeaders.cpp')
D:\Libraries\Ogre\test\Ogre\ogre-next\OgreMain\include\OgreString.h(226,21): error C4430: missing type specifier - int
assumed. Note: C++ does not support default-int [D:\Libraries\Ogre\test\Ogre\ogre-next\build\OgreMain\OgreMain.vcxproj]
(compiling source file '../../OgreMain/src/OgrePrecompiledHeaders.cpp')
Done!
I only changed CMake version for SDL change. After that ogre dependencies builds without problems, even FreeImage. It is Ogre 2.3 which does not build.
Yeah, thanks for checking.
I'll dig into it a little bit when I have time and see if I possibly can figure out a way to get around the issue.
At least now I know it's not my setup\system that is the issue.
The reason why I need 2.3 is because we have a massive codebase that uses 2.1, and I've been preparing for a upgrade of ogre in the project.
And I do not want to jump straight to the latest, so I figured 2.3 would be a nice fit (has some of the new features that we want).