add cmake flag to toggle the icu library link
some connector fix
only check for c++ compiler
fix compiler warning
fix segfault