Re: Windows8, WinRT, WOA & Metro
Posted: Sat Nov 03, 2012 7:00 pm
Sorry, only now committed the changes I wrote about in my last post here. Still no "how to", wait for it.
Support and community hang-out spot for Ogre3D
https://forums.ogre3d.org/
First issue is pointing to this code, in tif_dirinfo.c:Error 2 error C4996: '_lfind': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _lfind. See online help for details. d:\gamedevelopment\ogredepswinrt\src\freeimage-3.13.1\source\libtiff\tif_dirinfo.c 799 LibTIFF
Error 10 error LNK1181: cannot open input file 'D:\GameDevelopment\OgreDepsWinRT\src\FreeImage-3.13.1\Source\LibTIFF\Debug\LibTIFF.lib' D:\GameDevelopment\OgreDepsWinRT\src\FreeImage-3.13.1\Source\FreeImageLib\LINK FreeImageLib
Code: Select all
ret = (const TIFFFieldInfo **) lfind(&pkey,
tif->tif_fieldinfo,
&tif->tif_nfields,
sizeof(TIFFFieldInfo *),
tagNameCompare);
Code: Select all
Error 1 error C2027: use of undefined type 'Ogre::LogManager' D:\GameDevelopment\Ogre\Components\RTShaderSystem\src\OgreShaderGLSLESProgramWriter.cpp 198 OgreRTShaderSystem
Error 2 error C2228: left of '.logMessage' must have class/struct/union D:\GameDevelopment\Ogre\Components\RTShaderSystem\src\OgreShaderGLSLESProgramWriter.cpp 198 OgreRTShaderSystem
Error 3 error C3861: 'getSingleton': identifier not found D:\GameDevelopment\Ogre\Components\RTShaderSystem\src\OgreShaderGLSLESProgramWriter.cpp 198 OgreRTShaderSystem
Code: Select all
Error 12 error APPX0702: Payload file 'D:\GameDevelopment\Ogre\Samples\Browser\WinRT\cache.bin' does not exist. C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\AppxPackage\Microsoft.AppXPackage.Targets 926 SampleBrowserWinRT
Code: Select all
1>------ Build started: Project: SampleBrowserWinRT, Configuration: Release Win32 ------
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppBuild.targets(348,5): warning MSB8021: The value 'MultiByte' of the variable 'CharacterSet' is incompatible with the value 'true' of the variable 'WindowsAppContainer'.
Code: Select all
<VCMessage Code="MSB8021" Type="%(CompatibilityIssues.Type)" Arguments="%(CompatibilityIssues.FirstValue);%(CompatibilityIssues.FirstName);%(CompatibilityIssues.SecondValue);%(CompatibilityIssues.SecondName)" Condition="'%(CompatibilityIssues.Identity)' != '' and '$(DesignTimeBuild)'!='true'" />The English is OK, but I have fixed it a little to be more clear on some parts and more up to date (CMake 2.8.10 needed).Assaf Raman wrote:Will be happy to a "better English" version of "BuildingOgreWinRT.txt" and "BuildingOgreWindowsPhone.txt"
Code: Select all
To build Ogre in WinRT mode some manual steps are required:
1. The code and generated cmake solution can't be on a network drive -
else you will get a similar error when you will try to run the result exe:
"
Error : DEP0700 : Registration of the app in the layout folder "\bin\Debug\AppX" failed.
Rejecting a request to register from file:////bin/Debug/AppX/AppxManifest.xml because
the files are on a network share. Copy the files to the local computer before registering
the package.
"
I found this issue the hard way when working with VMWare and shared folders to the host
computer.
2. You need Windows 8 Release Preview (build 8400) or later.
Windows 8 Developer/Consumer Preview (build 8102/8250) are not supported.
We recommend using the final version of Windows 8. You can get a trial version
from the Microsoft site, google for it.
3. Using TortoiseHg or other Mercurial client, clone the patched dependency repository:
(https://bitbucket.org/assaframan/ogre-dependencies-winrt) -> C:\OgreDeps
Cg is not supported, and only headers from OIS are needed.
Also clone Ogre repository:
(https://bitbucket.org/sinbad/ogre/overview) -> C:\Ogre
4. You need Visual Studio 2012 Release Preview or later.
Note: There have been reports of issues with the express version.
We recommend using one of final version of Visual Studio 2012. You can get a
trial version from the Microsoft site, google for it.
5. Compile dependencies for all configurations that you plan to use before running CMake.
Dependencies for Win32 and for WinRT must be located in separate folders, Win32 version
can be built from OgreDependencies.VS2012.sln, WinRT from OgreDependencies.VS2012.WinRT.sln
6. Install CMake version 2.8.10 or later. (Earlier CMake versions have problems creating
VS2012 projects. CMake versions before 2.8.8 are missing the special target properties: VS_WINRT_EXTENSIONS and VS_WINRT_REFERENCES).
(http://www.cmake.org/)
Run CMake, select "Visual Studio 11" generator, specify ogre source and binary output folders,
then press "Configure". Specify WinRT dependencies folder, for example "C:\OgreDeps", and again
press "Configure". Select projects to build and press "Configure". When no more errors or red rows are shown, press "Generate".
7. Open the binary output folder specified in step 6. Open OGRE.sln. Remove the following
projects from the solution: ALL_BUILD, INSTALL, PACKAGE.
8. In WinRT mode VS2012 by default uses precompiled headers, and CMake can not yet prevent this.
So, open OGRE.sln in Visual Studio, select All projects (but not the solution itself)
Right click, than go to "Properties" select "Configuration Properties", than "All Configurations"
and under "Configuration Properties > General > Windows Store App Support" choose "Yes". After this
(not before) go to "Configuration Properties > C/C++ > Precompiled Headers > Precompiled Header"
and choose "Not Using Precompiled Headers".
9. As CMake can not generate valid WinRT app project we need to use our own.
Therefore "File > Add > Existing Project ..." and select
"Samples > Browser > WinRT > SampleBrowserWinRT.vcxproj".
Repeat this for "Samples > Browser > WinRT.Xaml > SampleBrowserWinRTXaml.vcxproj".
if this is your first time on that computer - you will be asked for a developer licence, do the
required steps.
10. Add dependencies to solution by right clicking the solution, selecting add existing project,
select "solution" in the combo next to the file select edit at the bottom then select the
dependencies solution, all the dependencies should be now a part of the solution. Remove OIS
project that you just add - but leave the rest in.
11. Add project dependencies: "SampleBrowserWinRT > Properties", than
"Common Properties > Framework and References", remove all existing references
and then "add" and in that window add a check mark next to all the projects on the list (except
for the SampleBrowser projects...)
Repeat this for SampleBrowserWinRTXaml.
In prerelease version of VS2012 it take big amount of time, but this bug was fixed in RTM.
12. Select only RenderSystem_Direct3D11 project in the solution tree, right click, properties, select all configs and "win32" platform in the combos at the top of the properties window, select "configuration properties"->"C++"->"General" on the tree on the left of that window, and set "Consume Windows Runtime Extension" to "Yes (/ZW)".
13. Try to build the solution.
14. If you have a compile issue with finding OIS.h - this is becouse SampleBrowserWinRT.vcxproj
wasn't generated by cmake, the way to fix it is just to copy paste the ois path from one of the
other projects "additional include directories" to SampleBrowserWinRT.vcxproj "additional
include directories" config.
15. If you get any compile\link error with "...mklink /J..." failed - it mean that the
code is not on a local drive (VMWare shared folder will not work for this...)
16. Select SampleBrowserWinRT or SampleBrowserWinRTXaml as the start up project and run.
Callstack tells me very little, and the exception has no information in it:First-change exception at 0x76274B32 in LoS3.exe: Microsoft C++ exception:
Platform:COMException ^ at memory location 0x0334F4F0.
HRESULT:0x8007007E
Code: Select all
KernelBase.dll!76274b32() Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for KernelBase.dll]
> msvcr110d.dll!_CxxThrowException(void * pExceptionObject, const _s__ThrowInfo * pThrowInfo) Line 152 C++
vccorlib110d.dll!__abi_WinRTraiseCOMException(long hr) Line 502 C++
LoS3.exe!__abi_WinRTraiseException(long __hrArg) Line 1156 C++
LoS3.exe!__abi_ThrowIfFailed(long __hrArg) Line 92 C++
LoS3.exe!Gaia::Game::Game(Windows::ApplicationModel::Core::CoreApplicationView ^ __param0) C++
LoS3.exe!LoS3::LoS3::[Windows::ApplicationModel::Core::IFrameworkView]::Initialize(Windows::ApplicationModel::Core::CoreApplicationView ^ applicationView) Line 21 C++
LoS3.exe!LoS3::LoS3::[Windows::ApplicationModel::Core::IFrameworkView]::__abi_Windows_ApplicationModel_Core_IFrameworkView____abi_Initialize(Windows::ApplicationModel::Core::CoreApplicationView ^ __param0) C++
Code: Select all
// Create Root Ogre object
mOgreRoot = new Ogre::Root("", "", ogreLogPath);
// Add Ogre Plugins
#if _DEBUG
mOgreRoot->loadPlugin("RenderSystem_Direct3D11_d.dll");
mOgreRoot->loadPlugin("Plugin_OctreeSceneManager_d.dll");
#else
mOgreRoot->loadPlugin("RenderSystem_Direct3D11.dll");
mOgreRoot->loadPlugin("Plugin_OctreeSceneManager.dll");
#endif
I wonder if there is an error with the way that Ogre tries to load another dll? The dll is in the same location as Ogre.. I don't know why it cannot be found, or if that error is accurate.15:33:46: OGRE EXCEPTION(7:InternalErrorException): Could not load dynamic library RenderSystem_Direct3D11_d.dll. System Error: The specified module could not be found.
in DynLib::load at ..\..\OgreMain\src\OgreDynLib.cpp (line 97)
Assaf Raman wrote:Turn on all exceptions (debug->exceptions ->check all boxes) - this will give you a better result.
One more thing that may be missing from the guide - I statically built OGRE - turn on in cmake OGRE_STATIC - as this may be a "load dll" issue.
D3D11 doesn't have a fixed pipeline, meaning you have to use shaders when rendering, the eRTShaderSystem stands for "realtime shader generator".KungFooMasta wrote: btw, how is the OgreRTShaderSystem_d.dll used? It's been a while since I used Ogre, and this new dll is foreign to me. Is it a plugin, or a component, and do I need it? (If so, how do I use it?)
You just link them statically, create an instance for each used plugin and invoke Ogre::Root::installPlugin().KungFooMasta wrote:how does static linking work with plugins? I thought we have to use dlls.
Code: Select all
Ogre::CgPlugin cg;
Ogre::OctreePlugin octreeSceneManager;
Ogre::Root::getSingleton().installPlugin( &cg );
Ogre::Root::getSingleton().installPlugin( &octreeSceneManager );
Code: Select all
//mOgreRoot->loadPlugin("RenderSystem_Direct3D11_d.dll");
mOgreRoot->loadPlugin("Plugin_OctreeSceneManager_d.dll");
Code: Select all
Error 4 error LNK1248: image size (80000078) exceeds maximum allowable size (80000000) D:\GameDevelopment\Ogre\static_link_bin\OgreMain\LINK OgreMain
Code: Select all
Error 2 error LNK2019: unresolved external symbol _D3DCompile@44 referenced in function "protected: void __thiscall Ogre::D3D11HLSLProgram::compileMicrocode(void)" (?compileMicrocode@D3D11HLSLProgram@Ogre@@IAEXXZ) D:\GameDevelopment\Win8\Gaia\RenderSystem_Direct3D11_d.lib(OgreD3D11HLSLProgram.obj) Gaia
Error 3 error LNK2019: unresolved external symbol _D3DReflect@16 referenced in function "protected: void __thiscall Ogre::D3D11HLSLProgram::compileMicrocode(void)" (?compileMicrocode@D3D11HLSLProgram@Ogre@@IAEXXZ) D:\GameDevelopment\Win8\Gaia\RenderSystem_Direct3D11_d.lib(OgreD3D11HLSLProgram.obj) Gaia
Error 4 error LNK2001: unresolved external symbol _IID_ID3D11ShaderReflection D:\GameDevelopment\Win8\Gaia\RenderSystem_Direct3D11_d.lib(OgreD3D11HLSLProgram.obj) Gaia
Code: Select all
uuid.lib;dxgi.lib;dxguid.lib;d3dcompiler.lib;d2d1.lib;d3d11.lib;dxgi.lib;ole32.lib;windowscodecs.lib;dwrite.lib