使用vs2013在Windows 7上进行Chromium构建失败(警告为错误)

时间:2014-08-03 14:37:53

标签: chromium ninja

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

以下是我运行'忍者'时出现的内容:

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 个答案:

答案 0 :(得分:0)

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

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

答案 1 :(得分: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

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

答案 2 :(得分: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

答案 3 :(得分:0)

使用带物料清单的UTF8

当我在win8上建立角度时,我受苦了