Welcome to the Urho3D beginner build guide!
This Guide describes how to create and build Urho3D from source via CodeBlocks project files. This guide is based on the official build guide (http://urho3d.github.io/documentation/1.4/_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 compile suite (GCC), but other systems and combinations are quite similar.
Note: This article has been updated because the build system for Urho has changed. The old article was for Urho 1.32 and can be found here: Build Urho3D 1.32 on Windows (MinGW) That old guide also describes how to use Makefiles, which may be different now with newer Urho versions.
The Guide used the following programs (links below):
- Urho3D (1.4) (as of 2015-10-09 the newest Urho version from Git is build the same way.)
- CMake (3.1.3)
- MinGW (4.9.2 32bit)
- CodeBlocks (Nightly 2015-01-31)
- Windows 7
Other program versions should work too and other programs (like Visual Studio instead of MinGW) would be similiar. [WIKINOTE: Maybe there could be different sections to split paths for like different IDEs]
1. Download Edit
- Urho3D: http://sourceforge.net/projects/urho3d/files/Urho3D/1.4/Urho3D-1.4-Source.zip/download
- CMake: http://www.cmake.org/download/ (direct to setup: http://www.cmake.org/files/v3.1/cmake-3.1.3-win32-x86.exe)
- MinGW: http://sourceforge.net/projects/mingw-w64/?source=typ_redirect
- CodeBlocks: http://forums.codeblocks.org/index.php/topic,19964.0.html (I picked the latest nightly because the last stable is quite old. These nightly builds can sometimes be unstable, this one seems fine though. IMPORTANT: you also need the two other files in the forum post: wxWidget DLL and mingw10m.dll. You may want to get a newer nightly or latest stable from http://www.codeblocks.org/downloads)
2. Install/Unpack Edit
- Install CMake and MinGW. I chose these settings for MinGW:
- Unpack CodeBlocks and put the two extra files also in that folder.
- Unpack Urho3D.
3. Build Codeblocks project files with the cmake script Edit
- Open a command prompt (cmd.exe) in your Urho3d folder. You can press Shift+F10 when being there with the Explorer and pick the command prompt from the menu or start cmd.exe and navigate to the folder manually with the cd command like: "cd S:\dev\Urho3D-1.4" and "S:" to switch the drive (if necessary) like:
- Use the cmake_codeblocks.bat (or .sh for other Non-Windows) with the "Build" option to create codeblocks project files. You can also set Urho build options here to customize the build. This could look like:Here I activated building the Urho samples and switched to OpenGL (instead of DirectX). The options can be found here: http://urho3d.github.io/documentation/1.4/_building.html
4. Build Edit
There should be a CodeBlocks project file called "Urho3D.cbp" inside the Build folder. Open that with CodeBlocks and build the the project by choosing Build->Build in the menu bar or by pressing Ctrl+F9. This may take quite some time:
When this is finished, CodeBlocks switches to "Buid messages" which looks like this:
and you are done with building Urho3D!
Now you can copy the "Data" and "CoreData" folder from the "bin" folder into "Build/bin" folder and start some of the freshly build samples in "Build/bin" (if you build them):
You may want to continue with the first project tutorial.