kartorz / AlphaIM

16 stars 5 forks source link

make error #1

Open PikachuHy opened 7 years ago

PikachuHy commented 7 years ago
CharUtil.cpp: In static member function 'static int CharUtil::ucs4CharToUTF8Byte(u32, char*)':
CharUtil.cpp:32:59: error: narrowing conversion of '192' from 'int' to 'char' inside { } [-Wnarrowing]
     const char prefix[] = {0, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC};
                                                           ^
CharUtil.cpp:32:59: error: narrowing conversion of '224' from 'int' to 'char' inside { } [-Wnarrowing]
CharUtil.cpp:32:59: error: narrowing conversion of '240' from 'int' to 'char' inside { } [-Wnarrowing]
CharUtil.cpp:32:59: error: narrowing conversion of '248' from 'int' to 'char' inside { } [-Wnarrowing]
CharUtil.cpp:32:59: error: narrowing conversion of '252' from 'int' to 'char' inside { } [-Wnarrowing]
Makefile:105: recipe for target 'CharUtil.o' failed
make: *** [CharUtil.o] Error 1
sonichy commented 6 years ago

Yes, I get the same error.

kartorz commented 5 years ago

这个同编译器有关,可以增加 -std=c++11, -Wno-narrowing 这两个编译选项来处理。 代码修正直接把 char 改成 unsigned char 就可以了。

wongser commented 4 years ago

您好,做的真好,目前我想用qt做一个语音打字的软件,现在已经可以实现接收到语音识别的字符了,不知道怎么把字符显示出来呢,如果您有好的建议,希望能指点一二。qq804859288