0

我正在尝试使用 VS2013 express Desktop 在 64 位 Windows 上构建 chromium(浏览器)。当我运行 'ninja' 来构建 chromium 时,它失败并出现以下错误:“错误 C2220:警告被视为错误 - 没有生成 'object' 文件”有没有人知道我必须做些什么来避免它?

以下是我运行“忍者”时出现的结果:

E:\chrome_build\depot_tools\src>ninja –C out\Debug chrome
ninja: Entering directory `out\Debug'
[352/18195] CXX obj\third_party\snappy\src\snappy.snappy-stubs-internal.obj
FAILED: ninja -t msvc -e environment.x86 -- "E:chrome_build\depot_tools\win_too
lchain\vs2013_files\VC\bin\cl.exe" /nologo /showInculdes /FC @obj\third_party\sn
appy\src\snappy.snappy-stubs-internal.obj.rsp /c ..\..\third_party\snappy\src\sn
appy-stubs-internal.cc /Foobj\third_party\snappy\src\snappy.snappy-stubs-interna
l.obj /Fdobj\third_party\snappy\snappy.cc.pdb
e:\chrome_build\depot_tools=src\third_party\snappy\src\snappy-stubs-internal.h :
 error C2220: warning treated as error - no 'object' file generated
e:\chrome_build\depot_tools=src\third_party\snappy\src\snappy-stubs-internal.h :
 warning C4819: The file contains a character that cannot be represented in the
current code page (949). Save the file in Unicode format to prevent data loss
[352/18195] CXX obj\third_party\snappy\src\snappy.snappy.obj
FAILED: ninja -t msvc -e environment.x86 -- "E:chrome_build\depot_tools\win_too
lchain\vs2013_files\VC\bin\cl.exe" /nologo /showInculdes /FC @obj\third_party\sn
appy\src\snappy.snappy.obj.rsp /c ..\..\third_party\snappy\src\snappy.cc /Foobj\
third_party\snappy\src\snappy.snappy.obj /Fdobj\third_party\snappy\snappy.cc.pdb

e:\chrome_build\depot_tools=src\third_party\snappy\src\snappy-stubs-internal.h :
 error C2220: warning treated as error - no 'object' file generated
e:\chrome_build\depot_tools=src\third_party\snappy\src\snappy-stubs-internal.h :
 warning C4819: The file contains a character that cannot be represented in the
current code page (949). Save the file in Unicode format to prevent data loss
[352/18195] CXX obj\device\hid\device_hid.hid_service_win.obj
ninja: build stopped: subcommand failed.

E:\chrome_build\depot_tools\src>
4

4 回答 4

0

为避免此警告,您需要将 Windows 系统代码页更改为英语或其他 SBCS 代码页。您可以通过Control Panel - Regions - Administrative - Language for non-Unicode programs.

https://groups.google.com/a/chromium.org/forum/#!msg/chromium-dev/3DV8Huz5C0M/oyvU9flBqMYJ

于 2014-11-17T01:15:20.477 回答
0

不可以。您不能将其保存为 UTF-8。我也遇到了同样的错误,我发现提到的文件已经是 UTF-8。(评论中有一些德语文本)另外,忍者建议将文件保存为 Unicode。

这是我收到的错误消息:

hash_tables.h:警告 C4819:文件包含当前代码页 (950) 中无法表示的字符。以 Unicode 格式保存文件以防止数据丢失

现在,相同的错误出现在 src/testing/gtest/include/gtest/internal/gtest-internal.h 和 third_party/libusb/src/libusb/stderror.c 下的几个标题中

此外,您是否正在 Windows 机器上进行编译?我也在 Windows 机器上进行开发。猜猜大多数其他用户正在使用 Linux。

=====

我在寻找其他可能的解决方案时遇到了这个问题:

http://www.chromium.org/developers/how-tos/build-instructions-windows#TOC-Build-failures-on-Vista

但我不认为这个建议是明智的。

于 2014-10-06T12:00:29.367 回答
0

e:\chrome_build\depot_tools=src\third_party\snappy\src\snappy-stubs-internal.h:警告 C4819:文件包含当前代码页中无法表示的字符 (949)。以 Unicode 格式保存文件以防止数据丢失

使用 notepad.exe 或任何您喜欢的文件打开文件,使用 utf-8 编码保存。

于 2014-08-20T02:28:17.643 回答
0

使用带有 BOM 的 UTF8

当我在win8上构建角度时我会遇到这个问题

于 2015-11-12T02:37:06.637 回答