Feed
Environment:
Windows8.1
VS2013
Ogre1.10 Stable
CMake 3.1.1
DXSDK Download
Dependencies Download
Compile
Compiling is actually relatively simple.
Install the CMAKE,DXSDK in advance.
To download 1.10 of the source code, unzip, create a build folder, source open CMake, drag CMakeList.txt to the interface, the build folder just set as the target folder.
A directory with a free type needs to be set up manually. Smooth words Configure-generate on the OK.
Go to the build directory, open the VS project, set the All_build as the active project, debug mode and release mode are all compiled again.
Finally run the sample Browser.
1.8 Version and 1.9 version of the source code compiled by the program can not display text, visual inspection is WINDOWS8 + VS2013 on a bug.
After all compiled, add a ogre_home environment variable, set to Ogre Source directory, the later project setup is more convenient.
Load Tutorial Application
Ran this debug de for three days --.
Tutorial application is a learning programming framework for the Ogre website, first to download Ogre Wiki Tutorial Framework 1.10-(Windows line endings)
Create a Win32 project in VS2013
Select the Win32 project, tick the Empty project , and always go the next step.
Add the extracted files to the project and end up like this
Next to configure the type of compilation, because Ogre compiled is 64-bit, so it can only compile 64-bit projects, right-click the project, Configuration Manager, add a x64 option.
On the project, right-click Add Include directory
It is difficult to fight one by one, directly adhere to the following can be.
$ (ogre_home) \ogremain\include;$ (ogre_home) \build\include;$ (ogre_home) \build\dependencies\include;$ (OGRE_HOME) \ build\dependencies\include\freetype2;$ (ogre_home) \build\dependencies\include\ois;$ (OGRE_HOME) \build\ dependencies\include\cg;$ (ogre_home) \build\dependencies;$ (ogre_home) \ogremain\include\threading;$ (OGRE_HOME) \ samples\common\include;$ (ogre_home) \components\rtshadersystem\include;$ (ogre_home) \Components\Overlay\include; $ (ogre_home) \samples\shadows\include;% ( Additionalincludedirectories)
Next is to add the link library
Libraries to link in debug mode
ois_d.lib;ogremain_d.lib;ogreoverlay_d.lib;% ( Additionaldependencies)
Libraries to connect in release mode
ois.lib;ogremain.lib;ogreoverlay.lib;% ( Additionaldependencies)
Set up the debug environment so that you do not have to copy the DLL, configuration properties, debugging environment.
Debug mode is set to the directory of the compiled debug library
Path=d:\vcworkspace\ogre_1_9_0\build\bin\debug
Release mode is set to the directory of the compiled release library
Path=d:\vcworkspace\ogre_1_9_0\build\bin\release
Put the X:\Path\of\Ogre\build\bin\debug under the
Resources_d.cfg
Plugins_d.cfg
and X:\Path\of\Ogre\build\bin\release under the
Resources.cfg
Plugins.cfg
Copy to the project source directory.
Add some code to TutorialApplication.cpp
void Tutorialapplication::createscene (void) {Mscenemgr->setambientlight (Ogre::colourvalue (1.0f, 1.0f, 1.0f)); O gre::entity* sinbadent = mscenemgr->createentity ("Sinbad.mesh"); ogre::scenenode* Sinbadsnode = mSceneMgr-> Getrootscenenode ()->createchildscenenode (); Sinbadsnode->attachobject (sinbadent);}
is to add Sinbad to the scene.
Compile and run, and then run, like this.
Some of the problems encountered
Release mode
OGRE EXCEPTION (6:filenotfoundexception): Cannot locate resource DUALQUATERNION_COMMON.GLSL in resource group Popular or a NY other group. In Resourcegroupmanager::openresource at.. \.. \.. \.. \ogremain\src\ogreresourcegroupmanager.cpp
Shader resource not added, Resources.cfg added
[Popular] Filesystem=d:/vcworkspace/ogre_1_9/samples/media/materials/programs/glsl
Fatal error LNK1112: module machine Type "X86" conflicts with Target machine type "x64"
Project setup is not correct, Ogre compiled 64-bit, the engineer 32-bit, refer to this setting:
Fatal error LNK1112: module machine Type "X86" Conflict with target machine type "x64"-My Solution
No options available in OGRE Engine Rendering Setup.
The configuration window does not have rendering system options.
Make sure there is a plugins.cfg file under the directory with
Plugin=rendersystem_direct3d9 Plugin=rendersystem_direct3d11 PLUGIN=RENDERSYSTEM_GL
Add run terminal to print debug information.
Modify TutorialApplication.cpp
AllocConsole (); Create Application Object tutorialapplication app; try { app.go (); } catch (ogre::exception& e) {#if Ogre_platform = = Ogre_platform_win32 MessageBox (NULL, E.getfulldescription (). C_STR (), "An exception have occurred!", MB_OK | Mb_iconerror | Mb_taskmodal); #else std::cerr << "An exception have occurred:" << e.getfulldescription (). C_STR () << Std::endl; #endif }freeconsole ();
Release mode is running normally, debug mode crashes, memory cannot be read.
This kind of mistake is the most pit, can not find the wrong at all, the interruption point is not so.
A little bit of print output slowly followed, and finally found #ifdef _DEBUG behind the code is not running.
Normally, debug mode defines _DEBUG macros, but this time there is no!
Manually add, DEBUG mode, configuration properties, c/c++-> preprocessor---preprocessor definition, add a _debug
The whole world is quiet ....
Reference
Setting up a application with Visual Studio-http://www.ogre3d.org/tikiwiki/setting+up+an+application+-+visual+studio
Fatal error LNK1112: module machine Type "X86" Conflict with target machine type "x64"-My solution-http://blog.csdn.net/tfy1028/article/details/8660823
Ogre's first program-http://blog.csdn.net/beyond_ray/article/details/25742969#reply
Windows compilation Ogre1.10