生成skia时出错:计算机类型x64与x86冲突



我正试图按照此处的说明构建Skiahttps://skia.org/docs/user/build/.我使用Visual Studio安装程序为Windows安装C++clang工具,然后按如下方式配置skia:

bin/gn gen out/Shared--args='lang_win="C: \Program Files(x86(\Microsoft Visual Studio\2019\Community\VC\Tools\Llvm"is_component_build=true is_debug=false is_official_build=true skia_se_system_expat=false skia_se_system_libjpeg_turbo=false skia_use_system_libpng=false skis_use_system-libwebp=false skio_use_system_zlib=false skin_use_system_icu=false skie_use_system_harfbuzz=false target_cpu="x64">

然后我运行了ninja -C out/Shared,但在构建过程中我得到了以下错误:

FAILED: skia.dll skia.dll.lib skia.dll.pdb
"C:Program Files (x86)Microsoft Visual Studio2019CommunityVCToolsLlvm/bin/lld-link.exe" /nologo /IMPLIB:./skia.dll.lib /DLL /OUT:./skia.dll /PDB:./skia.dll.pdb @./skia.dll.rsp
lld-link: error: libcmt.lib(std_type_info_static.obj): machine type x64 conflicts with x86
lld-link: error: libcmt.lib(chkstk.obj): machine type x64 conflicts with x86
lld-link: error: libcpmt.lib(locale0.obj): machine type x64 conflicts with x86
lld-link: error: libcpmt.lib(thread0.obj): machine type x64 conflicts with x86
lld-link: error: libcpmt.lib(xthrow.obj): machine type x64 conflicts with x86
lld-link: error: libcmt.lib(delete_scalar_size.obj): machine type x64 conflicts with x86
lld-link: error: libcmt.lib(new_scalar.obj): machine type x64 conflicts with x86
lld-link: error: libcmt.lib(utility.obj): machine type x64 conflicts with x86
lld-link: error: libcpmt.lib(xlock.obj): machine type x64 conflicts with x86
lld-link: error: libcpmt.lib(locale.obj): machine type x64 conflicts with x86
lld-link: error: libcpmt.lib(iosptrs.obj): machine type x64 conflicts with x86
lld-link: error: libcmt.lib(guard_support.obj): machine type x64 conflicts with x86
lld-link: error: libcpmt.lib(syserror.obj): machine type x64 conflicts with x86
lld-link: error: libcmt.lib(gshandler.obj): machine type x64 conflicts with x86
lld-link: error: libcmt.lib(gshandlereh4.obj): machine type x64 conflicts with x86
lld-link: error: libcmt.lib(amdsecgs.obj): machine type x64 conflicts with x86
lld-link: error: libcmt.lib(gs_cookie.obj): machine type x64 conflicts with x86
lld-link: error: libcmt.lib(delete_scalar.obj): machine type x64 conflicts with x86
lld-link: error: libcmt.lib(throw_bad_alloc.obj): machine type x64 conflicts with x86
lld-link: error: libcmt.lib(cpu_disp.obj): machine type x64 conflicts with x86
lld-link: error: too many errors emitted, stopping now (use /errorlimit:0 to see all errors)
ninja: build stopped: subcommand failed.

我正在运行64位版本的Windows 11。有人知道这个问题可能是什么吗?

好的,因为某种原因(不确定是什么原因(,Skia使用Visual Studio安装程序安装的LLVM版本有问题。我直接从他们的官方网站下载了LLVM,然后运行:

bin/gn gen out/Shared--args='lang_win="C: \Program Files\LLVM"is_component_build=true is_debug=false is_official_build=true skia_se_system_expat=false skia_se_system_libjpeg_turbo=false skia_use_system_libpng=false skis_use_system-libwebp=false skio_use_system_zlib=false skin_use_system_icu=false skie_use_system_harfbuzz=false target_cpu="x64">

运行此Skia构建时没有任何错误。

最新更新