Urho3D Wiki
(Added mingw setup picture which I forgot. Slightly changed Windows SDK text.)
Tags: Visual edit apiedit
(DirectX End-User Runtime (June 2010) seems to be required to run DX9 or 11 apps and is not shipped with Windows 10)
Tags: Visual edit apiedit
 
(2 intermediate revisions by the same user not shown)
Line 14: Line 14:
 
*CodeBlocks (15.12 RC1, the IDE this guide uses, you could also use something else)
 
*CodeBlocks (15.12 RC1, the IDE this guide uses, you could also use something else)
 
*Windows 7 / 8 / 10 (64bit)
 
*Windows 7 / 8 / 10 (64bit)
*Windows SDK
+
*Windows SDK (optional, sometimes needed for DirectX)
  +
*DirectX End-User Runtime (June 2010) (required to run DirectX 9 or 11 programs, may be already installed)
 
Other program versions should work too and other programs (like Visual Studio instead of MinGW) are similiar.
 
Other program versions should work too and other programs (like Visual Studio instead of MinGW) are similiar.
 
==1. Download and Installation==
 
==1. Download and Installation==
Line 21: Line 22:
 
*MinGW64: http://sourceforge.net/projects/mingw-w64/?source=typ_redirect
 
*MinGW64: http://sourceforge.net/projects/mingw-w64/?source=typ_redirect
 
*CodeBlocks: http://forums.codeblocks.org/index.php/topic,20729.0.html (there's also a Codeblocks bundled with MinGW but that MinGW doesn't work properly, just get Codeblocks)
 
*CodeBlocks: http://forums.codeblocks.org/index.php/topic,20729.0.html (there's also a Codeblocks bundled with MinGW but that MinGW doesn't work properly, just get Codeblocks)
*Windows 10 SDK: https://dev.windows.com/en-US/downloads/windows-10-sdk (needed for DirectX among other things. The former DirectX SDK is now part of the Windows SDK.)
+
*Windows 10 SDK: https://dev.windows.com/en-US/downloads/windows-10-sdk (optional, sometimes needed for DirectX among other things. The former DirectX SDK is now part of the Windows SDK.)
  +
*DirectX End-User Runtime: https://www.microsoft.com/en-us/download/details.aspx?id=8109 (required to run DirectX 9 or 11 programs, may be already installed)
 
When installing MinGW, you may want to pick "x86_64" as the architecture if you want to build 64bit software:
 
When installing MinGW, you may want to pick "x86_64" as the architecture if you want to build 64bit software:
[[File:Mingw setup.png|none|thumb|527x527px]]
+
[[File:Mingw setup.png|center|thumb|527x527px]]
 
(i686 is 32bit) The rest should be left on default.
 
(i686 is 32bit) The rest should be left on default.
 
When installing CMake, select one of the two options to add it to the system PATH:
 
When installing CMake, select one of the two options to add it to the system PATH:

Latest revision as of 09:16, 17 December 2015

Welcome to the Urho3D beginner build guide!

This Guide describes how to create and build Urho3D from source.

This guide is based on the official build guide (http://urho3d.github.io/documentation/1.5/_building.html) but provides a more complete guide (with dependencies) and is a step by step guide with images, which should be easier for beginners. This guide uses Windows and CodeBlocks as an IDE with the MinGW compiler suite (GCC), but other systems and combinations are quite similar.

There are also older guides for Urho 1.4 and Urho 1.32, the later one uses Makefiles.

This guide uses the following programs (links below):

  • Urho3D (1.5)
  • CMake (3.4.1, this is the build system used by Urho)
  • MinGW64 (5.2.0 64bit)
  • CodeBlocks (15.12 RC1, the IDE this guide uses, you could also use something else)
  • Windows 7 / 8 / 10 (64bit)
  • Windows SDK (optional, sometimes needed for DirectX)
  • DirectX End-User Runtime (June 2010) (required to run DirectX 9 or 11 programs, may be already installed)

Other program versions should work too and other programs (like Visual Studio instead of MinGW) are similiar.

1. Download and Installation[]

When installing MinGW, you may want to pick "x86_64" as the architecture if you want to build 64bit software:

Mingw setup

(i686 is 32bit) The rest should be left on default. When installing CMake, select one of the two options to add it to the system PATH:

Cmake setup

All other programs can be installed with default settings. Unpack Urho somewhere.

2. Setup Codeblocks[]

For me Codeblocks couldn't automatically find the compiler so I had to specify it manually:

Codeblocks setup
  1. Go to "Settings" (in menu bar) -> "Compiler"
  2. "Global compiler settings" -> "Toolchain executable"
  3. Select the path of MinGW's /bin and change the program names to match the one there.

3. Set up MinGW for CMake[]

You have to modify your system path so that Urho's CMake scripts can find your MinGW:

Mingw path
  1. Open an explorer window and right click on "This PC".
  2. -> Properties
  3. -> Advanced System Settings
  4. -> Environment Variables
  5. Select "Path"
  6. -> Edit
  7. Copy the path to where you installed MinGW. You need the /bin subdirectory. (you can click in and copy from the marked address bar)
  8. Enter a ; and paste the path. (Entries in this list are seperated by semicolons.)
  9. Click Ok everywhere.

4. Run CMake to create the project files for Urho[]

Cmake urho
  1. Go to where you have unpacked Urho
  2. Click "File"->"Open command prompt" or press Shift+Rightclick somewhere in the folder or Shift+F10 to open a menu with the "Open command window here" option. This opens a terminal.
  3. Start the "cmake_codeblocks.bat" script with a folder name as a parameter (doesn't have to exist) where you want to create the project files. This folder can also be outside of the Urho folder.

You can also set build options for Urho when executing the script, for example:

cmake_codeblocks.bat Build -DURHO3D_OPENGL=0 -DURHO3D_WIN32_CONSOLE=1

This builds Urho with DirectX9 instead of OpenGL (default) and with the console option (displays logging in a terminal when using the samples). See http://urho3d.github.io/documentation/1.5/_building.html for all options.

5. Building Urho[]

  1. Open the project that that the script just created in the build folder (here "Build/Urho3D.cbp").
  2. Use Ctrl+F9 or the gear-wheel symbol to build Urho. This takes a while and prints a lot to the build log:
Build urho

and you are done with building Urho3D!

If you also build the samples you can find them in your Build/bin:

Urho sample

You may want to continue with the first project tutorial.