A hobbyist Mobile/PC/Android/Console game development blog
This guide is based on my install of Urho3D 1.3.1 on a 32bit Mint Linux.
It should be understandable for other linux distros and windows, ie just use the .bat file instead of the .sh files.
These are my quick notes while testing Urho3D, the details are in the links.
I don’t do any of this for a living ie gamedev, linux, cmake, nor C++, so if you find mistakes, please let me know.
I believe in having (all!) the source code, but you can install Urho3D as a prebuilt library.
To start, firstly read the build help page.
Especially the build options at the bottom!
Also read the other build targets as it will give clues, ie how to use the build option ie: -D if your new to cmake!
It’s not a race, read it! The steps below are current for now, but would have changed over time.
You may need to install extra software to have an environment ready for compiling, ie for 32bit mint linux:
sudo apt-get install build-essential gcc cmake libglu1-mesa-dev libogg-dev libopenal-dev libgtk-2.0-dev curl libpcrecpp0:i386 libasound2-dev libxrandr-dev
I recommend cloning the github repository and downloading the source via github to your user folder ~/ ie: ~/Urho3D-master
This way you can contribute any bug fixes you may find.
Once you have the code downloaded and your OS is setup, you run the setup script.
My build looks like this:
./cmake_codeblocks.sh Build -DCMAKE_BUILD_TYPE=Debug -DURHO3D_SAMPLES=1 -DURHO3D_DOCS=1 -DURHO3D_EXTRAS=1
For tracing/debugging code.
For installing and building the sample code.
For generating the HTML class documentation, doxygen required.
If you don’t want to install doxygen, you can get the help HTML files from any of the static binary builds from the home page.
Just in case it’s required later.
the -J3 tells make to use 3 CPU cores, I like to leave one spare for background tasks.
Once compiled, you will have:
* Executables (samples, editor & NinjaSnowWar ) in the Bin folder
* Optionally, your documentation is in Docs/html/index.html (Bookmark it!)
* FYI all the source files (third party, engine, tools, samples, etc) are in the Source folder
If you get cmake failing because it’s missing a library, you simply install library it’s missing.
If you get linking errors like this:
Linking CXX executable /home/user/Urho3D-1.31/Bin/Urho3DPlayer
/usr/bin/ld: cannot find -lGL
collect2: error: ld returned 1 exit status
make: *** [/home/user/Urho3D-1.31/Bin/Urho3DPlayer] Error 1
make: *** [Tools/Urho3DPlayer/CMakeFiles/Urho3DPlayer.dir/all] Error 2
make: *** [all] Error 2
It usually means that make (or gcc) can not find your library in the default location or with the correct library name.
In this case you can create a symbolic link from the library file to /usr/lib without a version number in the filename ie:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/libGL.so
Read the sample documentation and start playing!
Here is a youtube video of me quickly going through all the Urho3D samples:
Next, I’ll do a quick code explanation of the Hello World sample.