Warning C4819:The file contains a character that can ot be represented in the current code page(936)

这个警告,跟代码本身无关,而是某一行里面,存在一个或者多个Unicode字符,查找起来非常困难。

解决方法:

1. 打开出现warning的文件,Ctrl+A全选,然后在文件菜单:file->Advanced save options,在弹出的选项中选择新的编码方式为:UNICODE- codepage 1200 ,点确定后编译。

2. 在代码中加上:#pragma warning(disable:C4819),直接忽略这个警告。

3. 在cuda工程设置中,cuda runtime API的Host选项卡中的Extra C++ Option中填入/WD4819就直接搞定了,根本不用改代码或者是从新保存文件!!!!!!!!!!!!!!!

你可能感兴趣的:(Warning C4819:The file contains a character that can ot be represented in the current code page(936))