Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make error #1

Open
PikachuHy opened this issue Oct 13, 2017 · 3 comments
Open

make error #1

PikachuHy opened this issue Oct 13, 2017 · 3 comments

Comments

@PikachuHy
Copy link

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
Copy link

sonichy commented Feb 26, 2018

Yes, I get the same error.

@kartorz
Copy link
Owner

kartorz commented Jun 23, 2019

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

@wongser
Copy link

wongser commented Nov 7, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants