added a version which uses CmiReference (compiling with option -DCMI_COMLIB_WITH_REFE...