我正在尝试编译 Windows 版本的 Chromium。我遵循了提到的指导原则这里当我运行以下命令时,最后一部分出现错误:
gn gen out/Default
查看了导致错误的代码(python 语言)后,我注意到了这一点:
for path in env['LIB'].split(';'):
if os.path.exists(os.path.join(path, 'User32.Lib')):
vc_lib_um_path = os.path.realpath(path)
break
然后
assert vc_lib_um_path
最后这一行导致了错误,这让我认为问题可能是由于程序找不到“User32.lib”。我在 Windows 10(64 位)系统上,我想知道是否有一个环境变量需要更新以便可以找到这个库。我愿意接受任何建议。
我的路径变量:
完整的错误信息:
Traceback (most recent call last):
File "D:/Work/chromium/src/build/toolchain/win/setup_toolchain.py", line 274, in <module>
main()
File "D:/Work/chromium/src/build/toolchain/win/setup_toolchain.py", line 269, in main
assert vc_lib_um_path
AssertionError
ERROR at //build/toolchain/win/BUILD.gn:400:22: Script returned non-zero exit code.
x64_toolchain_data = exec_script("setup_toolchain.py",
^----------
Current dir: D:/Work/chromium/src/out/Default/
Command: D:/Work/depot_tools/win_tools-2_7_6_bin/python/bin/python.exe -- D:/Work/chromium/src/build/toolchain/win/setup_toolchain.py "C:\Program Files (x86)/Microsoft Visual Studio/2017/Community" "C:\Program Files (x86)\Windows Kits\10" "C:\WINDOWS\Sysnative;C:\WINDOWS/SysWOW64" win x64 environment.x64 false
Returned 1 and printed out:
vc_bin_dir = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.13.26128\\bin\\HostX64\\x64" include_flags_I = "\"/IC:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.13.26128\\ATLMFC\\include\" \"/IC:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.13.26128\\include\" \"/IC:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.16299.0\\ucrt\" \"/IC:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.15063.0\\shared\" \"/IC:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.15063.0\\um\" \"/IC:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.15063.0\\winrt\" \"/IC:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.15063.0\\cppwinrt\"" include_flags_imsvc = "\"-imsvcC:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.13.26128\\ATLMFC\\include\" \"-imsvcC:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.13.26128\\include\" \"-imsvcC:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.16299.0\\ucrt\" \"-imsvcC:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.15063.0\\shared\" \"-imsvcC:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.15063.0\\um\" \"-imsvcC:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.15063.0\\winrt\" \"-imsvcC:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.15063.0\\cppwinrt\"" vc_lib_path = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.13.26128\\lib\\x64" vc_lib_atlmfc_path = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.13.26128\\ATLMFC\\lib\\x64"
See //BUILD.gn:60:1: which caused the file to be included.
group("gn_all") {
^----------------
Traceback (most recent call last):
File "D:/Work/chromium/src/build/toolchain/win/setup_toolchain.py", line 274, in <module>
main()
File "D:/Work/chromium/src/build/toolchain/win/setup_toolchain.py", line 269, in main
assert vc_lib_um_path
AssertionError
Traceback (most recent call last):
File "D:/Work/chromium/src/build/toolchain/win/setup_toolchain.py", line 274, in <module>
main()
File "D:/Work/chromium/src/build/toolchain/win/setup_toolchain.py", line 269, in main
assert vc_lib_um_path
AssertionError
谢谢
答案1
我在 Windows 10(64 位)系统上,我想知道是否有环境变量需要更新以便可以找到此库。我愿意接受任何建议。
根据构建说明,您必须安装10.0.15063 Windows 10 SDK。
您必须安装版本 10.0.15063 Windows 10 SDK。这可以单独安装,也可以通过选中 Visual Studio 安装程序中的相应框来安装。还必须安装 SDK 调试工具。如果 Windows 10 SDK 是通过 Visual Studio 安装程序安装的,则可以通过以下方式安装它们:控制面板 → 程序 → 程序和功能 → 选择“Windows 软件开发工具包” → 更改 → 更改 → 选中“适用于 Windows 的调试工具” → 更改。或者,您可以下载独立的 SDK 安装程序并使用它来安装调试工具。