Visual Studio 2022 Setup

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
User avatar
ghoulsblade
Halfling
Posts: 86
Joined: Sun Mar 05, 2006 2:55 pm
Location: Germany
x 2

Visual Studio 2022 Setup

Post by ghoulsblade »

hi all! heres my notes for how to setup Ogre13.6.4 visual studio 2022, maybe they'll help someone.

Code: Select all

Ogre3D 13.6.4 visual studio 17 / 2022
* download ogre source and unzip to C:\dev\lib\ogre-13.6.4
* open cmake gui : 
** source C:\dev\lib\ogre-13.6.4
** build  C:\dev\lib\ogre-13.6.4\build
* click configure
* click generate 
* click open project to open it in visual studio
* select Debug x64 in the toolbar , rclick ALL_BUILD in the left panel > build
* select RelWithDebInfo x64 in the toolbar , rclick ALL_BUILD in the left panel > build
* rclick INSTALL in the left panel > build  (creates build\sdk\)

for your own project in visual studio :
create a folder C:\dev\myproject\
* copy C:\dev\lib\ogre-13.6.4\Samples\Tutorials .cpp and CMakeLists.txt to C:\dev\myproject\
* copy C:\dev\lib\ogre-13.6.4\build\sdk\Media to C:\dev\myproject\Media\
* copy C:\dev\lib\ogre-13.6.4\build\sdk\bin .dll files to C:\dev\myproject\bin\
** also plugins.cfg and resources.cfg to C:\dev\myproject\bin\
* open cmake gui : 
** source C:\dev\myproject
** build  C:\dev\myproject\build
* click configure
* set OGRE_DIR to C:\dev\lib\ogre-13.6.4\build\sdk\CMake
* click configure
* click generate 
* click open project to open it in visual studio
* select RelWithDebInfo x64 in the toolbar 
* rclick 0_Bootstrap, Properties > Debugging > set "Working Dir.." to $(ProjectDir)\..\bin

to run full "Debug" mode without optimizations (so you can see loop variable values etc) :
in project properties : C/C++ : Code Generation : Runtime Library : set this to "Multi-threaded DLL (/MD)"
otherwise you get a weird crash on ogre init when you use the same bin/ dir with the RelWithDebInfo .dlls

for a true "Debug" compile of ogre DLL see https://github.com/OGRECave/ogre/issues/1303

happy to see ogre still going strong, i used it many years ago and just got back to it. cheers and keep up the good work!

Last edited by ghoulsblade on Tue May 30, 2023 5:37 pm, edited 2 times in total.
User avatar
ghoulsblade
Halfling
Posts: 86
Joined: Sun Mar 05, 2006 2:55 pm
Location: Germany
x 2

Re: Visual Studio 2022 Setup

Post by ghoulsblade »

to run full "Debug" mode without optimizations (so you can see loop variable values etc) :
in project properties : C/C++ : Code Generation : Runtime Library : set this to "Multi-threaded DLL (/MD)"
otherwise you get a weird crash on ogre init when you use the same bin/ dir with the RelWithDebInfo .dlls

for a true "Debug" compile of ogre DLL see https://github.com/OGRECave/ogre/issues/1303