gpt4 book ai didi

c++ - 尝试构建 Skia 时缺少头文件

转载 作者:太空宇宙 更新时间:2023-11-04 12:32:05 25 4
gpt4 key购买 nike

我正在尝试使用 Skia Windows 上的图形库需要 building it from source .但是,当我运行构建命令时:

ninja -C out/Static

我得到这个构建错误:

"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC/Tools/MSVC/14.23.28105/bin/HostX64/x64/cl.exe" /nologo /showIncludes /FC -D_CRT_SECURE_NO_WARNINGS -D_HAS_EXCEPTIONS=0 -DWIN32_LEAN_AND_MEAN -DNOMINMAX -DNDEBUG -DSK_GAMMA_APPLY_TO_A8 -DSKIA_IMPLEMENTATION=1 -DSK_HAS_PNG_LIBRARY "-IC:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.23.28105/include" "-IC:/Program Files (x86)/Windows Kits/10/Include/10.0.18362.0/shared" "-IC:/Program Files (x86)/Windows Kits/10/Include/10.0.18362.0/ucrt" "-IC:/Program Files (x86)/Windows Kits/10/Include/10.0.18362.0/um" "-IC:/Program Files (x86)/Windows Kits/10/Include/10.0.18362.0/winrt" -I../.. /bigobj /utf-8 /O2 /Zc:inline  /GR- /c ../../src/codec/SkPngCodec.cpp /Foobj/src/codec/png.SkPngCodec.obj /Fd"obj/png_c.pdb"
path\to\skia\src\codec\SkPngCodec.cpp(25): fatal error C1083: Cannot open include file: 'png.h': No such file or directory

我尝试再次运行它,现在我得到了一个不同的错误:

"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC/Tools/MSVC/14.23.28105/bin/HostX64/x64/cl.exe" /nologo /showIncludes /FC -DSK_PDF_USE_SFNTLY -D_CRT_SECURE_NO_WARNINGS -D_HAS_EXCEPTIONS=0 -DWIN32_LEAN_AND_MEAN -DNOMINMAX -DNDEBUG -DSK_GAMMA_APPLY_TO_A8 -DSKIA_IMPLEMENTATION=1 -DSK_SUPPORT_PDF -DSK_HAS_JPEG_LIBRARY -DU_USING_ICU_NAMESPACE=0 "-IC:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.23.28105/include" "-IC:/Program Files (x86)/Windows Kits/10/Include/10.0.18362.0/shared" "-IC:/Program Files (x86)/Windows Kits/10/Include/10.0.18362.0/ucrt" "-IC:/Program Files (x86)/Windows Kits/10/Include/10.0.18362.0/um" "-IC:/Program Files (x86)/Windows Kits/10/Include/10.0.18362.0/winrt" -I../.. -I../../third_party/externals/sfntly/cpp/src /bigobj /utf-8 /O2 /Zc:inline  /GR- /c ../../src/pdf/SkDeflate.cpp /Foobj/src/pdf/pdf.SkDeflate.obj /Fd"obj/pdf_c.pdb"
C:\Users\natan\Desktop\skia\src\pdf\SkDeflate.cpp(16): fatal error C1083: Cannot open include file: 'zlib.h': No such file or directory

我如何获得所有这些丢失的文件?

最佳答案

如回答on the Skia google group ,如果您缺少某些库,则需要在生成构建文件时通过传递 skia_use_foo=false 来禁用依赖于缺少库的部分,如下所示:

"bin/gn.exe" gen out/Static --args="is_official_build=true skia_use_libpng=false skia_use_zlib = false skia_use_libjpeg_turbo=false skia_use_harfbuzz=false skia_use_libwebp=false skia_use_expat=false"

然后正常构建使用

ninja -C out/Static

如果您缺少其他库,请使用

找出禁用它们的语法
gn args --list out/Static 

(如果不知道头文件属于哪个库,google一下也有帮助)

关于c++ - 尝试构建 Skia 时缺少头文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58287158/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com