On 5 November 2012 18:34, Jonathan Wakely wrote: > > My guess is there's code that looks like: > > #if __cplusplus >= 201103L > typedef char16_t LEUnicode; > #else > typedef unsigned short LEUnicode; > #endif > > and the library was built with -std=c++11 and harfbuzz is not. And it looks as though I'm almost spot on, http://source.icu-project.org/repos/icu/icu/trunk/source/common/unicode/umachine.h has: /* Define UChar to be compatible with char16_t or wchar_t if possible. */ #if U_HAVE_CHAR16_T typedef char16_t UChar; #elif U_SIZEOF_WCHAR_T==2 typedef wchar_t UChar; #elif defined(__CHAR16_TYPE__) typedef __CHAR16_TYPE__ UChar; #else typedef uint16_t UChar; #endif and http://source.icu-project.org/repos/icu/icu/trunk/source/common/unicode/platform.h has #ifdef U_HAVE_CHAR16_T /* Use the predefined value. */ #else /* * Notes: * Visual Studio 10 (_MSC_VER>=1600) defines char16_t but * does not support u"abc" string literals. * gcc 4.4 defines the __CHAR16_TYPE__ macro to a usable type but * does not support u"abc" string literals. * C++11 requires support for UTF-16 literals */ # if (defined(__cplusplus) && __cplusplus >= 201103L) # define U_HAVE_CHAR16_T 1 # else # define U_HAVE_CHAR16_T 0 # endif #endif So the problem is that your library is built with C++11 and your code using the library isn't. Not a GCC issue, and nothing to do with optimization flags.