Problem Compiling Ogre in Visual Studio 2015

Problems building or running the engine, queries about how to use features etc.
Post Reply
ProfesorX
Halfling
Posts: 96
Joined: Thu Oct 07, 2004 7:18 pm
Location: Veracruz, Mexico

Problem Compiling Ogre in Visual Studio 2015

Post by ProfesorX »

Ogre Version: v13.6.4 (repository)
Operating System: Windows 10 [Version 10.0.19045.2251]
Render System: DirectX 11

Hello, I have returned after a long absence, and I want to resume my learning of ogre from where I left off before.

Before, I was able to compile Ogre from source with no problem, but now that I'm back, things have changed a lot.

I tried to follow the guide to compile ogre, but I must be doing something wrong, because it doesn't work correctly.

I will start leaving the steps that I have followed, and the errors that I have obtained to see if someone can help me and tell me what part I am doing wrong, and how I can correct it

  1. I have downloaded ogre from the repository with git clone
    git clone https://github.com/OGRECave/ogre

  2. The source code is in the following folder: H:\OneDrive\SVN\ogre

  3. I have created a folder called H:\OneDrive\SVN\ogre_build

  4. I use the following command to generate the solution files for Visual Studio 2015

cmake -G "Visual Studio 14 2015" -A x64 --fresh -S H:\OneDrive\SVN\ogre -B H:\OneDrive\SVN\ogre_build

Here I have noticed that it downloads the following files, I suppose from the internet, (I thought that it did not download source code, I don't know if this is normal):

3.24.tar.gz (seems to be bullet)
freetype-2.12.1.tar.gz
imgui.tar.gz
pugixml-1.12.tar.gz
SDL2-2.24.1.tar.gz
v5.2.5.tar.gz
zlib-1.2.13.tar.gz

cmake create several folders inside ogre_build.

  1. I open the OGRE.sln file generated by CMake to compile the project in visual studio

  2. I select Debug and ALL_BUILD and build

  3. This is where I get stuck, link errors appear when compiling the OgreBullet, OgreXMLConverter and Plugin_DotScene projects, a total of 99, the same error in various symbols, I don't put them all, just the first one, but the others are similar:

Error LNK2038 mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in OgreBullet.obj OgreBullet H:\OneDrive\SVN\ogre_build\Components\Bullet\BulletDynamics.lib(btDiscreteDynamicsWorld.obj)

  1. I go to the folder, H:\OneDrive\SVN\ogre_build\bin\debug and yes several files were generated, but indeed, OgreBullet, OgreXMLConverter and Plugin_DotScene are missing.

  2. I try to run the sample file SampleBrowser_d.exe, I have to remove the Plugin_DotScene plugin from the plugins.cfg file for it to load, and it does load, but with error:

Assertion failed
Program H:\OneDive\SVN\ogre_build\bin\debug\OgreBytes_d.dll
File: h:\onedrive\svn\ogre\ogremain\include\OgreMath.h line:695
Expression minval <= maxval && "invalid clamp range"
For information on how your program can cause an assertion failure, see Visual C++ documentation on assertions
(Press Retry to debug the application, -JIT must be enabled)

I give ignore and I get the following:

The requested sample plugins where missing, corrupted or invalid
.\DefaultSamples

and the list of examples appears empty

Image
rpgplayerrobin
Gnoll
Posts: 619
Joined: Wed Mar 18, 2009 3:03 am
x 353

Re: Problem Compiling Ogre in Visual Studio 2015

Post by rpgplayerrobin »

It may be that Visual Studio 2015 is not supported anymore?
However, I could not find any information about which Visual Studio version is the lowest required, but I know that 2017 works since that is what I use (for 1.12.13 though).

This is how I build it:
viewtopic.php?p=554037#p554037

User avatar
ghoulsblade
Halfling
Posts: 86
Joined: Sun Mar 05, 2006 2:55 pm
Location: Germany
x 2

Re: Problem Compiling Ogre in Visual Studio 2015

Post by ghoulsblade »

try my notes for visual studio 2022
viewtopic.php?t=97013
use RelWithDebInfo instead of Debug.
I got errors during debug for compiling ogre itself too, but my project runs fine even in debug compile with the RelWithDebInfo dlls after i set
C/C++ : Code Generation : Runtime Library : set this to "Multi-threaded DLL (/MD)"
in my project.

Post Reply