Preconditions:
Base system is Windows 10
Visual Studio Community Free 2015 is used for compilation (64 bit)
These instructions only apply to Ogre3D V2.1
DirectX:
If you want to use DirectX in Ogre3D, the 'Windows Software Development Kit (SDK) for Windows 10' is required.
Mandatory for compiling SDL2 however, is the use of the DirectX Software Development Kit 'DirectX 9 SDK (DX SDK June 2010)'; this version is not used by
Ogre3D V2.1 (because it doesn't use DirectX 9 anymore), but it is only used for SDL2
1. Get the Windows Software Development Kit (SDK) for Windows 10 from https://dev.windows.com/en-us/downloads/windows-10-sdk
2. Download 'sdksetup.exe' and install the SDK (this will take some time)
3. Get the DirectX Software Development Kit from https://www.microsoft.com/en-us/downloa ... px?id=6812; this is the 'DirectX 9 SDK (DX SDK June 2010)'
4. Run the downloaded 'DXSDK_Jun10.exe'
5. This results in an error 'Setup failed'. Just ignore it and press 'Finish'.
Get Visual Studio Community Free 2015 and install it:
1. Download 'Visual Studio Community Free' from https://www.visualstudio.com/en-us/down ... io-vs.aspx
2. Run 'vs_community_ENU.exe' (installation takes about half and hour)
Get Ogre 3D V2.1:
The easiest way to download Ogre3D is to grab the zip file directly from Bitbucket.
1. Go to https://bitbucket.org/sinbad/ogre/downloads
2. Select the tab 'Branches'
3. Download branch 'v2-1'
4. This downloads file 'sinbad-ogre-xxxxxxxxxxxx.zip'
5. Create a subdirectory in 'C:\Users\LoggedInUser\Documents\Visual Studio 2015\Projects' named 'Ogre2.1'
Use your own name as a replacement for 'LoggedInUser'
6. Extract the zip file (everything in 'sinbad-ogre-xxxxxxxxxxxx') in the directory 'C:\Users\LoggedInUser\Documents\Visual Studio 2015\Projects\Ogre2.1'
So, do not include 'sinbad-ogre-xxxxxxxxxxxx'.
Get the dependencies:
1. Make a subdirectory in 'C:\Users\LoggedInUser\Documents\Visual Studio 2015\Projects\Ogre2.1' named 'Dependencies'
2. Download the dependencies from 'https://bitbucket.org/cabalistic/ogredeps/downloads'
3. Select the tab 'Branches'
4. Download 'default'; this downloads the file 'cabalistic-ogredeps-zzzzzzzzzzzz.zip'
5. Extract the content of this file in 'C:\Users\LoggedInUser\Documents\Visual Studio 2015\Projects\Ogre2.1\Dependencies'
6. Get SDL from 'https://www.libsdl.org/download-2.0.php'. To be sure, compile it yourself. Download 'SDL2-2.0.3.zip - GPG signed' (this is currently the highest version)
5. Extract the content of this file in 'C:\Users\LoggedInUser\Documents\Visual Studio 2015\Projects\Ogre2.1\Dependencies\src'
6. Rename the subdir 'SDL2-2.0.3' to 'SDL2' to please CMake
The structure in 'C:\Users\LoggedInUser\Documents\Visual Studio 2015\Projects\Ogre2.1\Dependencies\src\' is:
Get CMake and install it:AMD_Quad_Buffer_SDK_v11
Cg
FreeImage
freetype
NVAPI-R313-developer
ois
SDL2
zlib
zziplib
CMakeLists.txt
1. Download CMake from https://cmake.org/
2. No 64 bit installer was provided, so the 32 bit version was downloaded (cmake-3.4.1-win32-x86.exe)
3. Install 'cmake-3.4.1-win32-x86.exe'
Compile the dependencies:
1. Start CMake
2. Fill in for 'where is the source code' the path 'C:/Users/LoggedInUser/Documents/Visual Studio 2015/Projects/Ogre2.1/Dependencies'
3. Fill in for 'where to build the binaries' the path 'C:/Users/LoggedInUser/Documents/Visual Studio 2015/Projects/Ogre2.1/Dependencies'
4. Press button 'Configure'
5. Select for 'Specify the generator for this project' the appropriate compiler; in this case it is 'Visual Studio 14 2015 Win 64'
6. Set radiobutton to 'use default native compilers' and press button 'Finish' (if you get errors because it cannot find the compiler (CMAKE_CXX_COMPILER), use 'specify native compilers')
7. Notice that all lines are red. Just press 'Configure' again. The lines are blank now
8. Press button 'Generate'
9. Start 'Visual Studio 2015'
10. Open the solution located in 'C:\Users\LoggedInUser\Documents\Visual Studio 2015\Projects\Ogre2.1\Dependencies\OGREDEPS.sln'
11. Build the solution (both Debug and Release, both in x64).
12. OIS_d.dll and OIS.dll are in C:\Users\LoggedInUser\Documents\Visual Studio 2015\Projects\Ogre2.1\Dependencies\bin\... When running an Ogre3D sample, this results in an error, because it cannot find the dll files.Note, intially the build resulted in '========== Build: 6 succeeded, 2 failed, 0 up-to-date, 0 skipped =========='
One error was:
'CUSTOMBUILD : *** error : DIRECTX requires the $DXSDK_DIR environment variable to be set'.
This can be ignored, and it was because 'Windows Software Development Kit (SDK) for Windows 10' does not set the DXSDK_DIR environment variable.
It was part of 'DirectX 9 SDK (DX SDK June 2010)', which was not installed during the first attempt.
The other error was in freeimage:
'C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error: Macro definition of snprintf conflicts with Standard Library function declaration'
I've updated the file 'tif_config.h' and commented the following lines from line 85:
#ifdef _WIN32
#define snprintf _snprintf
#define lfind _lfind
#endif // _WIN32
This had to be done manually, because an incorrect version of the Dependecies was used; the 'default' branch of the dependencies did not result in this error.
For convenience, copy the 'C:\Users\LoggedInUser\Documents\Visual Studio 2015\Projects\Ogre2.1\Dependencies\bin\' directory to 'C:\Users\LoggedInUser\Documents\Visual Studio 2015\Projects\Ogre2.1\Dependencies\bin\src\'
Compile SDL2 separately:
SDL2 is not compiled as part of the compilation of the OGREDEPS.sln solution. Just compile it separately:
1. Start 'Visual Studio 2015' (if not yet started)
2. Open the solution located in 'C:\Users\LoggedInUser\Documents\Visual Studio 2015\Projects\Ogre2.1\Dependencies\src\SDL2\VisualC\SDL_VS2013.sln'
3. Visual Studio 2015 automatically upgrades the 2013 solution
4. Build the solution (both Debug and Release, both in x64).
Compile Ogre3D:
1. Start CMake (do not forget to clear the cache by means of File > Delete Cache)
2. Fill in for 'where is the source code' the path 'C:/Users/LoggedInUser/Documents/Visual Studio 2015/Projects/Ogre2.1'
3. Fill in for 'where to build the binaries' the path 'C:/Users/LoggedInUser/Documents/Visual Studio 2015/Projects/Ogre2.1/VCBuild'
4. Press button 'Configure'. Choose for button 'Yes' on the question 'Build directory does not exist; should I create it?'
5. Select for 'Specify the generator for this project' the appropriate compiler; in this case it is 'Visual Studio 14 2015 Win 64'
6. Set radiobutton to 'use default native compilers' and press button 'Finish'
7. Notice that some lines are red and an error is displayed 'error in configuration process; project files may be invalid'. This is because it cannot find SDL2MAIN_LIBRARY, SDL2_INCLUDE_DIR and SDL2_LIBRARY_TEMP
Code: Select all
Set the following values to these items:
SDL2MAIN_LIBRARY = C:\Users\LoggedInUser\Documents\Visual Studio 2015\Projects\Ogre2.1\Dependencies\src\SDL2\VisualC\SDLmain\x64\Release\SDL2main.lib
SDL2_INCLUDE_DIR = C:\Users\LoggedInUser\Documents\Visual Studio 2015\Projects\Ogre2.1\Dependencies\src\SDL2\include
SDL2_LIBRARY_TEMP = C:\Users\LoggedInUser\Documents\Visual Studio 2015\Projects\Ogre2.1\Dependencies\src\SDL2\VisualC\SDL\x64\Release\SDL2.lib
9. Uncheck 'OGRE_INSTALL_SAMPLES'
10. Press 'Configure' until all lines are blank
11. Press button 'Generate'
12. Start 'Visual Studio 2015' (if not yet started)
13. Open the solution located in 'C:\Users\LoggedInUser\Documents\Visual Studio 2015\Projects\Ogre2.1\VCBuild\OGRE.sln'
14. Build the solution (both Debug and Release, both in x64).
Run Ogre3D:
1. Apparently, SDL2.dll was not copied, so manually copy 'C:\Users\LoggedInUser\Documents\Visual Studio 2015\Projects\Ogre2.1\Dependencies\src\SDL2\VisualC\SDL\x64\Release\SDL2.dll' to
'C:\Users\LoggedInUser\Documents\Visual Studio 2015\Projects\Ogre2.1\VCBuild\bin\Debug\' and 'C:\Users\LoggedInUser\Documents\Visual Studio 2015\Projects\Ogre2.1\VCBuild\bin\Release\'
2. Run the samples in 'C:\Users\LoggedInUser\Documents\Visual Studio 2015\Projects\Ogre2.1\VCBuild\bin\Release\'