Extending openCV from pure 2D world to 3D environments seems challengeable – the first one is to find out the a 3D engine to support 3D rendering, based on the data gained from openCV. Irrlicht engine is seemed as a good option, as it provides good supports to 3D rendering with open source codes. However, compiling the engine for ubuntu & eclipse use is not an easy job. When I tried to run the first helloworld example, the problem popped up –
Undefined reference to 'createDevice()'.
This is caused by the lack of library file link – this can be the result of incorrent type of library path, or an incorrect link of library files. Typically, irrlicht needs self compilation to get the library file in Linux. The compilation instructions give clear steps to do the job, which generates the lib file –
libIrrlicht.a. Unfortunately linking this lib in the project does not work, even worse it generates hundreds of
undefined reference to ... errors.
A lot googling was done to find out the cause of this error, with no helpful info in conanical irrlicht forum. While re-checking the instructions of irrlicht compilation, something was noticed:
A shared library may be a choice, instead of generating the lib in irrlicht folder, so
make sharelib && sudo make install, the lib files as well as included head files were installed in
/usr/local/lib. Linking these to the irrlicht project – bingo – it worked, all errors gone!!!