This compiles fine as long as you have a Coin3D library patched to fix the error about:
coin3d/3.1.3p2/x86_64-slc6-gcc62-opt/include/Inventor/SbBasic.h:99:23: error: 'cc_debugerror_post' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation
If you see this error while compiling, you should add this line:
#include <Inventor/C/errors/debugerror.h>
to the file: /usr/local/include/Inventor/SbBasic.h