Info: using Urho3d with old Mac OSX (10.11)

Here is some information on getting started with building and using Urho3D for Mac OSX users running 10.11 El Capitan.

  1. When trying to build Urho3D I ran into a bug with one of the dependencies. Apply this patch to fix this issue in file Urho3D/Source/ThirdParty/SDL/src/video/cocoa/SDL_cocoavideo.h. It should look like
/* Fix build with the 10.10 SDK */
#define NSEventSubtypeTouch NSTouchEventSubtype
/* Fix build with the 10.11 SDK */
#define NSEventSubtypeMouseEvent NSMouseEventSubtype
  1. When building, I found that the precompiled header isn’t supported. See this thread (it’s a common problem for Mac users). Go into CMakeCache.txt and set “URHO3D_PCH:BOOL=OFF”, or pass -DURHO3D_PCH=OFF to cmake when building the library.
  2. Move the Urho3D folder to a location where it can live for the rest of its life. I have a folder called ‘Libs’.
  3. Whenever you make a new project that will pull in the built Urho3D as a library (e.g. by adapting this or following this tutorial) you have to add the library’s location to the ‘URHO3D_HOME’ environment variable. I went to my sample project’s CMakeCache.txt and set ‘URHO3D_HOME:PATH=/Users/vmost/Libs/Urho3D’. A more reliable way is to add export URHO3D_HOME=~/Libs/Urho3D to your script file, or bake it into your CMakeLists.txt file with set (ENV{URHO3D_HOME} "~/Libs/Urho3D").
  4. When I built my sample project for a little ‘hello world’, the console spit out a bunch of garbage, which you can silence with this patch. Dive into the sample project’s CMakeLists.txt file and add these lines:
set(other_flags "${other_flags} -frtti -fvisibility-inlines-hidden")
set(other_flags "${other_flags} -fvisibility=hidden")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++ ${other_flags}")

With those issues out of the way, here is how to actually build the library (you need git and cmake installed, which can be done with homebrew).

  1. git clone
  2. cd Urho3D
  3. cmake .
  4. make
  5. oh, it’s done (after 30mins and assuming nothing else crops up); in Urho3D/bin are a bunch of samples that have been automatically built. You can also use the ‘Urho3DPlayer’ found in that same folder to run a script. It can run any of the samples
    a. cd Urho3D/bin
    b. ./Urho3DPlayer Scripts/ [options]
    c. example option (see the docs): -v turns on vertical sync, which is interesting

And some hints on setting up a sample project. Keep this page in mind, as it has a lot of information!

  1. This tutorial is a good starting spot.
  2. Rather than try and put together everything from scratch, it’s best to just copy several things and run the cmake script to do the rest of the work. Here are the essential parts of an infant project.
    a. Folder: bin; contains [CoreData] and [Data] folders (can copy them out of Urho3D/bin)
    b. Folder: CMake; contains [Modules] and [Toolchains] folders (can copy Urho3D/CMake folder directly)
    c. Folder: script; contains [] (can copy out of Urho3D/script), and [] which contains the line $(dirname $0)/ Use the second one for adding stuff instead of editing the generic script.
    d. Folder: Source; put C++ source files in here (code files, header files, etc). Need at least one file e.g. ‘app_main.cpp’ which creates an Application derived class and calls URHO3D_DEFINE_APPLICATION_MAIN(MyApp)
    e. File: CMakeLists.txt; paste in the stuff from this link. Have to change ‘project name’ and ‘target name’, and add these lines since I prefer putting source files in their own folder:
# Define source files
file (GLOB SRC_CPP_FILES Source/*.cpp)
file (GLOB SRC_H_FILES Source/*.h)
  1. The happy moment is when you hit script/ ./ and make, and then your executable shows up in project_folder/bin.

note: There are so many things to learn here, I hope these resources are helpful pointers.

Anyway, that’s the first step on this journey.


A few months back I managed to compile and run the engine on an (~15 year) old machine - my first laptop - after enabling “stub ARB_occlusion_query support on 915/945” in driconf and reducing the minimum required CMake version, which also required the following modification:

+ source_group ("Source Files" FILES ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_FILES})

Spec Value
Manufacturer Medion
Model name Akoya Mini
Model id E1210
CPU Intel Atom (Diamondville)
CPU speed 1600 Mhz
Graphics Intel 945GME
OS Linux Mint
Display Size 10.2" 1024x600
RAM 1024 MB
Hard Disk 160 GB
Weight 1191 g
Size 259x180x31.0 mm

Using a bluetooth dongle it even supports wireless PS3 controllers. :slightly_smiling_face:

Obviously there’s features it does not like at all; shadows, normal maps and many lights make it hog.