首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Skia C++ VS2015项目设置

Skia C++ VS2015项目设置
EN

Stack Overflow用户
提问于 2018-10-29 13:14:51
回答 2查看 1.1K关注 0票数 1

我试图在visual 2015上使用Skia和C++创建一个简单的windows应用程序。我相信我已经创建了skia.lib的静态、共享和发布版本,并链接到了适当的包含文件夹。但是现在我仍然遇到了很多错误,这表明有一个比仅仅链接更大的问题。我尝试将Skia解决方案中的工作HelloWorld项目中的配置属性复制到我自己的配置中,但没有取得任何成功。

在库生成之后,对于让Skia使用VS2015有任何明确的说明吗?如果不是,为什么当我尝试在裸露的模板win32项目中使用Skia时会遇到(许多不同的)问题?是否有更好的方法将属性从一个项目复制到另一个项目?

我对VS和C++还比较陌生。我使用VS2015和C++,因为我正在进行的一个更大项目的其他部分似乎需要这个平台。所以我想我要做的是做一个独立的斯基亚“你好世界”的例子。

对于为as 2015/7构建Skia有一些挫折感。以下是我如何管理我所拥有的,希望它能帮助其他人取得一些进展,同时也能揭示我当前的问题。

  • 仓库工具中的Git包似乎是不够的。所以在Depot_tools之前安装了Git。
  • Visual 2017的构建工具是必需的,尽管本例中的目标是VS 2015。
  • 按照Depot_tools安装说明到"TL;DR“。
  • 按照Skia设置的指令,直到"python工具/git-sync-deps“。
  • 而不是使用创建skia/out/文件夹的指令提供的参数,如下所示: bin\gn gen out/静态-ide=gn 2015 --args="is_official_build=true“bin\gn gen out/Shared -ide=gn 2015-args=”is_official_build=true is_component_build=true“bin\gn gen out/Debug -ide=gn 2015 bin\gn gen out/is_debug=false-ide=gn 2015-args=”is_debug=false“
  • 运行“忍者退出/共享/静态/发布/调试”似乎注定要失败,因为这些路径似乎没有由gn正确创建。相反,在VS2015中的每个/out/*中打开sln。然后找到了'skia‘项目并建立了它。(还构建了pathkit项目)
  • 这在静态、共享和发行版中创建了skia.lib (和pathkit.lib),但是Debug版本没有工作。
  • Skia文档中关于VS的其他说明根本不起作用。例如,"python /bots/assets/win_toolchain/Dowload.py -t C:/toolchain“和/或"python -t -t C:/toolchain”。也许这会引起以后的问题。但是,包含的HelloWorld项目确实以这种方式成功地编译和运行。

作为对Hans的答复,下面是试图构建/out/ solution解决方案时生成的错误。

代码语言:javascript
复制
Error   MSB3073 The command "call ninja.exe -C ../../../../../out/Release/  obj/modules/sksg/samples.stamp" exited with code 1. samples ((skia)\(modules)\(sksg)\samples)   C:\Users\Me\Documents\skia\out\Release\obj\modules\sksg\samples.vcxproj 64  
Error   MSB3073 The command "call ninja.exe -C ../../../../../out/Release/  ./sksg.lib" exited with code 1. sksg    C:\Users\Me\Documents\skia\out\Release\obj\modules\sksg\sksg.vcxproj    160 
Error   MSB3073 The command "call ninja.exe -C ../../../../../out/Release/  obj/modules/skottie/tool.stamp" exited with code 1. tool    C:\Users\Me\Documents\skia\out\Release\obj\modules\skottie\tool.vcxproj 64  
Error   C1083   Cannot open compiler generated file: 'C:\Users\Me\Documents\skia\out\Release\obj\src\gpu\effects\gpu.GrOvalEffect.obj': Permission denied   skottie C:\Users\Me\Documents\skia\src\gpu\effects\GrOvalEffect.cpp 1   
Error   MSB3073 The command "call ninja.exe -C ../../../../../out/Release/  obj/modules/skottie/skottie.stamp" exited with code 1.  skottie C:\Users\Me\Documents\skia\out\Release\obj\modules\skottie\skottie.vcxproj  108 
Error   MSB3073 The command "call ninja.exe -C ../../../out/Release/  ./lua_pictures.exe" exited with code 1.   lua_pictures    C:\Users\Me\Documents\skia\out\Release\obj\lua_pictures.vcxproj 66  
Error   C1083   Cannot open compiler generated file: 'C:\Users\Me\Documents\skia\out\Release\obj\src\sksl\gpu.SkSLMetalCodeGenerator.obj': Permission denied    skshaper    C:\Users\Me\Documents\skia\src\sksl\SkSLMetalCodeGenerator.cpp  1   
Error   MSB3073 The command "call ninja.exe -C ../../../../../out/Release/  obj/modules/skshaper/skshaper.stamp" exited with code 1.    skshaper    C:\Users\Me\Documents\skia\out\Release\obj\modules\skshaper\skshaper.vcxproj    64  
Error   C1083   Cannot open compiler generated file: 'C:\Users\Me\Documents\skia\out\Release\obj\src\gpu\text\gpu.GrGlyphCache.obj': Permission denied  pathops_unittest    C:\Users\Me\Documents\skia\src\gpu\text\GrGlyphCache.cpp    1   
Error   MSB3073 The command "call ninja.exe -C ../../../out/Release/  ./pathops_unittest.exe" exited with code 1.   pathops_unittest    C:\Users\Me\Documents\skia\out\Release\obj\pathops_unittest.vcxproj 290 
Error   C1083   Cannot open compiler generated file: 'C:\Users\Me\Documents\skia\out\Release\obj\src\sksl\gpu.SkSLParser.obj': Permission denied    public_headers_warnings_check   C:\Users\Me\Documents\skia\src\sksl\SkSLParser.cpp  1   
Error   MSB3073 The command "call ninja.exe -C ../../../out/Release/  obj/public_headers_warnings_check.stamp" exited with code 1.  public_headers_warnings_check   C:\Users\Me\Documents\skia\out\Release\obj\public_headers_warnings_check.vcxproj    64  
Error   C1083   Cannot open compiler generated file: 'C:\Users\Me\Documents\skia\out\Release\obj\src\effects\effects.SkTrimPathEffect.obj': Permission denied   sk_app  C:\Users\Me\Documents\skia\src\effects\SkTrimPathEffect.cpp 1   
Error   C1083   Cannot open compiler generated file: 'C:\Users\Me\Documents\skia\out\Release\obj\src\gpu\gl\gpu.GrGLGLSL.obj': Permission denied    nanoMech    C:\Users\Me\Documents\skia\src\gpu\gl\GrGLGLSL.cpp  1   
Error   MSB3073 The command "call ninja.exe -C ../../../out/Release/  obj/sk_app.stamp" exited with code 1. sk_app  C:\Users\Me\Documents\skia\out\Release\obj\sk_app.vcxproj   88  
Error   MSB3073 The command "call ninja.exe -C ../../../out/Release/  ./nanoMech.exe" exited with code 1.   nanoMech    C:\Users\Me\Documents\skia\out\Release\obj\nanoMech.vcxproj 66  
Error   C1083   Cannot open compiler generated file: 'C:\Users\Me\Documents\skia\out\Release\obj\src\pdf\pdf.SkPDFUtils.obj': Permission denied skia    C:\Users\Me\Documents\skia\src\pdf\SkPDFUtils.cpp   1   
Error   MSB3073 The command "call ninja.exe -C ../../../out/Release/  ./skia.lib" exited with code 1.   skia    C:\Users\Me\Documents\skia\out\Release\obj\skia.vcxproj 1690    
Error       opening build log: Permission denied    skp_parser  C:\Users\Me\Documents\skia\out\Release\obj\ninja    1   
Error   MSB3073 The command "call ninja.exe -C ../../../out/Release/  ./skp_parser.exe" exited with code 1. skp_parser  C:\Users\Me\Documents\skia\out\Release\obj\skp_parser.vcxproj   66  
Error       opening build log: Permission denied    skpMech C:\Users\Me\Documents\skia\out\Release\obj\ninja    1   
Error   MSB3073 The command "call ninja.exe -C ../../../out/Release/  ./skpMech.exe" exited with code 1.    skpMech C:\Users\Me\Documents\skia\out\Release\obj\skpMech.vcxproj  66  
Error       opening build log: Permission denied    skpinfo C:\Users\Me\Documents\skia\out\Release\obj\ninja    1   
Error   MSB3073 The command "call ninja.exe -C ../../../out/Release/  ./skpinfo.exe" exited with code 1.    skpinfo C:\Users\Me\Documents\skia\out\Release\obj\skpinfo.vcxproj  66  
Error       opening build log: Permission denied    sktexttopdf C:\Users\Me\Documents\skia\out\Release\obj\ninja    1   
Error   MSB3073 The command "call ninja.exe -C ../../../out/Release/  ./sktexttopdf.exe" exited with code 1.    sktexttopdf C:\Users\Me\Documents\skia\out\Release\obj\sktexttopdf.vcxproj  66  
Error       opening build log: Permission denied    sse2    C:\Users\Me\Documents\skia\out\Release\obj\ninja    1   
Error   MSB3073 The command "call ninja.exe -C ../../../out/Release/  obj/sse2.stamp" exited with code 1.   sse2    C:\Users\Me\Documents\skia\out\Release\obj\sse2.vcxproj 75  
Error       opening build log: Permission denied    sse41   C:\Users\Me\Documents\skia\out\Release\obj\ninja    1   
Error   MSB3073 The command "call ninja.exe -C ../../../out/Release/  obj/sse41.stamp" exited with code 1.  sse41   C:\Users\Me\Documents\skia\out\Release\obj\sse41.vcxproj    64  
Error       opening build log: Permission denied    sse42   C:\Users\Me\Documents\skia\out\Release\obj\ninja    1   
Error   MSB3073 The command "call ninja.exe -C ../../../out/Release/  obj/sse42.stamp" exited with code 1.  sse42   C:\Users\Me\Documents\skia\out\Release\obj\sse42.vcxproj    64  
Error       opening build log: Permission denied    ssse3   C:\Users\Me\Documents\skia\out\Release\obj\ninja    1   
Error   MSB3073 The command "call ninja.exe -C ../../../out/Release/  obj/ssse3.stamp" exited with code 1.  ssse3   C:\Users\Me\Documents\skia\out\Release\obj\ssse3.vcxproj    69  
Error       opening build log: Permission denied    tests ((skia)\tests)    C:\Users\Me\Documents\skia\out\Release\obj\ninja    1   
Error   MSB3073 The command "call ninja.exe -C ../../../out/Release/  obj/tests.stamp" exited with code 1.  tests ((skia)\tests)    C:\Users\Me\Documents\skia\out\Release\obj\tests.vcxproj    1405    
Error   MSB3073 The command "call ninja.exe -C ../../../out/Release/  ./lua_app.exe" exited with code 1.    lua_app C:\Users\Me\Documents\skia\out\Release\obj\lua_app.vcxproj  66  
Error       opening build log: Permission denied    Nima-Cpp    C:\Users\Me\Documents\skia\out\Release\obj\third_party\Nima-Cpp\ninja   1   
Error   MSB3073 The command "call ninja.exe -C ../../../../../out/Release/  obj/third_party/Nima-Cpp/Nima-Cpp.stamp" exited with code 1.    Nima-Cpp    C:\Users\Me\Documents\skia\out\Release\obj\third_party\Nima-Cpp\Nima-Cpp.vcxproj    234 
Error       opening build log: Permission denied    expat   C:\Users\Me\Documents\skia\out\Release\obj\third_party\expat\ninja  1   
Error       opening build log: Permission denied    harfbuzz    C:\Users\Me\Documents\skia\out\Release\obj\third_party\harfbuzz\ninja   1   
Error   MSB3073 The command "call ninja.exe -C ../../../../../out/Release/  obj/third_party/expat/expat.stamp" exited with code 1.  expat   C:\Users\Me\Documents\skia\out\Release\obj\third_party\expat\expat.vcxproj  70  
Error   MSB3073 The command "call ninja.exe -C ../../../../../out/Release/  obj/third_party/harfbuzz/harfbuzz.stamp" exited with code 1.    harfbuzz    C:\Users\Me\Documents\skia\out\Release\obj\third_party\harfbuzz\harfbuzz.vcxproj    190 
Error       opening build log: Permission denied    icu C:\Users\Me\Documents\skia\out\Release\obj\third_party\icu\ninja    1   
Error   MSB3073 The command "call ninja.exe -C ../../../../../out/Release/  obj/third_party/icu/icu.stamp" exited with code 1.  icu C:\Users\Me\Documents\skia\out\Release\obj\third_party\icu\icu.vcxproj  782 
Error       opening build log: Permission denied    imgui   C:\Users\Me\Documents\skia\out\Release\obj\third_party\imgui\ninja  1   
Error   MSB3073 The command "call ninja.exe -C ../../../../../out/Release/  obj/third_party/imgui/imgui.stamp" exited with code 1.  imgui   C:\Users\Me\Documents\skia\out\Release\obj\third_party\imgui\imgui.vcxproj  70  
Error       opening build log: Permission denied    jsoncpp C:\Users\Me\Documents\skia\out\Release\obj\third_party\jsoncpp\ninja    1   
Error   MSB3073 The command "call ninja.exe -C ../../../../../out/Release/  obj/third_party/jsoncpp/jsoncpp.stamp" exited with code 1.  jsoncpp C:\Users\Me\Documents\skia\out\Release\obj\third_party\jsoncpp\jsoncpp.vcxproj  70  
Error       opening build log: Permission denied    libjpeg C:\Users\Me\Documents\skia\out\Release\obj\third_party\libjpeg-turbo\ninja  1   
Error   MSB3073 The command "call ninja.exe -C ../../../../../out/Release/  obj/third_party/libjpeg-turbo/libjpeg.stamp" exited with code 1.    libjpeg C:\Users\Me\Documents\skia\out\Release\obj\third_party\libjpeg-turbo\libjpeg.vcxproj    242 
Error       opening build log: Permission denied    libmicrohttpd   C:\Users\Me\Documents\skia\out\Release\obj\third_party\libmicrohttpd\ninja  1   
Error       opening build log: Permission denied    libpng  C:\Users\Me\Documents\skia\out\Release\obj\third_party\libpng\ninja 1   
Error   MSB3073 The command "call ninja.exe -C ../../../../../out/Release/  obj/third_party/libmicrohttpd/libmicrohttpd.stamp" exited with code 1.  libmicrohttpd   C:\Users\Me\Documents\skia\out\Release\obj\third_party\libmicrohttpd\libmicrohttpd.vcxproj  98  
Error   MSB3073 The command "call ninja.exe -C ../../../../../out/Release/  obj/third_party/libpng/libpng.stamp" exited with code 1.    libpng  C:\Users\Me\Documents\skia\out\Release\obj\third_party\libpng\libpng.vcxproj    126 
Error       opening build log: Permission denied    libwebp C:\Users\Me\Documents\skia\out\Release\obj\third_party\libwebp\ninja    1   
Error       opening build log: Permission denied    libwebp_avx2    C:\Users\Me\Documents\skia\out\Release\obj\third_party\libwebp\ninja    1   
Error   MSB3073 The command "call ninja.exe -C ../../../../../out/Release/  obj/third_party/libwebp/libwebp.stamp" exited with code 1.  libwebp C:\Users\Me\Documents\skia\out\Release\obj\third_party\libwebp\libwebp.vcxproj  490 
Error   MSB3073 The command "call ninja.exe -C ../../../../../out/Release/  obj/third_party/libwebp/libwebp_avx2.stamp" exited with code 1. libwebp_avx2    C:\Users\Me\Documents\skia\out\Release\obj\third_party\libwebp\libwebp_avx2.vcxproj 62  
Error       opening build log: Permission denied    lua ((skia)\(third_party)\(lua)\lua)    C:\Users\Me\Documents\skia\out\Release\obj\third_party\lua\ninja    1   
Error   MSB3073 The command "call ninja.exe -C ../../../../../out/Release/  obj/third_party/lua/lua.stamp" exited with code 1.  lua ((skia)\(third_party)\(lua)\lua)    C:\Users\Me\Documents\skia\out\Release\obj\third_party\lua\lua.vcxproj  190 
Error       opening build log: Permission denied    libwebp_sse41   C:\Users\Me\Documents\skia\out\Release\obj\third_party\libwebp\ninja    1   
Error   MSB3073 The command "call ninja.exe -C ../../../../../out/Release/  obj/third_party/libwebp/libwebp_sse41.stamp" exited with code 1.    libwebp_sse41   C:\Users\Me\Documents\skia\out\Release\obj\third_party\libwebp\libwebp_sse41.vcxproj    74  
Error       opening build log: Permission denied    zlib    C:\Users\Me\Documents\skia\out\Release\obj\third_party\zlib\ninja   1   
Error   MSB3073 The command "call ninja.exe -C ../../../../../out/Release/  obj/third_party/zlib/zlib.stamp" exited with code 1.    zlib    C:\Users\Me\Documents\skia\out\Release\obj\third_party\zlib\zlib.vcxproj    118 
Error       opening build log: Permission denied    zlib_x86    C:\Users\Me\Documents\skia\out\Release\obj\third_party\zlib\ninja   1   
Error   MSB3073 The command "call ninja.exe -C ../../../../../out/Release/  obj/third_party/zlib/zlib_x86.stamp" exited with code 1.    zlib_x86    C:\Users\Me\Documents\skia\out\Release\obj\third_party\zlib\zlib_x86.vcxproj    70  
Error       opening build log: Permission denied    tool_utils  C:\Users\Me\Documents\skia\out\Release\obj\ninja    1   
Error   MSB3073 The command "call ninja.exe -C ../../../out/Release/  obj/tool_utils.stamp" exited with code 1. tool_utils  C:\Users\Me\Documents\skia\out\Release\obj\tool_utils.vcxproj   156 
Error       opening build log: Permission denied    typeface_freetype   C:\Users\Me\Documents\skia\out\Release\obj\ninja    1   
Error   MSB3073 The command "call ninja.exe -C ../../../out/Release/  obj/typeface_freetype.stamp" exited with code 1.  typeface_freetype   C:\Users\Me\Documents\skia\out\Release\obj\typeface_freetype.vcxproj    59  
Error       opening build log: Permission denied    viewer  C:\Users\Me\Documents\skia\out\Release\obj\ninja    1   
Error   MSB3073 The command "call ninja.exe -C ../../../out/Release/  ./viewer.exe" exited with code 1. viewer  C:\Users\Me\Documents\skia\out\Release\obj\viewer.vcxproj   115 
Error       opening build log: Permission denied    webp    C:\Users\Me\Documents\skia\out\Release\obj\ninja    1   
Error   MSB3073 The command "call ninja.exe -C ../../../out/Release/  obj/webp.stamp" exited with code 1.   webp    C:\Users\Me\Documents\skia\out\Release\obj\webp.vcxproj 72  
Error       opening build log: Permission denied    wuffs   C:\Users\Me\Documents\skia\out\Release\obj\ninja    1   
Error   MSB3073 The command "call ninja.exe -C ../../../out/Release/  obj/wuffs.stamp" exited with code 1.  wuffs   C:\Users\Me\Documents\skia\out\Release\obj\wuffs.vcxproj    59  
Error       opening build log: Permission denied    xml C:\Users\Me\Documents\skia\out\Release\obj\ninja    1   
Error   MSB3073 The command "call ninja.exe -C ../../../out/Release/  obj/xml.stamp" exited with code 1.    xml C:\Users\Me\Documents\skia\out\Release\obj\xml.vcxproj  80  
Error   C1083   Cannot open compiler generated file: 'C:\Users\Me\Documents\skia\out\Release\obj\src\gpu\effects\gpu.GrPorterDuffXferProcessor.obj': Permission denied  samples ((skia)\samples)    C:\Users\Me\Documents\skia\src\gpu\effects\GrPorterDuffXferProcessor.cpp    1   
Error   MSB3073 The command "call ninja.exe -C ../../../out/Release/  obj/samples.stamp" exited with code 1.    samples ((skia)\samples)    C:\Users\Me\Documents\skia\out\Release\obj\samples.vcxproj  454 
Error   C1083   Cannot open compiler generated file: 'C:\Users\Me\Documents\skia\out\Release\obj\src\pathops\skia.SkPathWriter.obj': Permission denied  Mech    C:\Users\Me\Documents\skia\src\pathops\SkPathWriter.cpp 1   
Error   LNK1104 cannot open file 'obj\src\utils\skia.SkNWayCanvas.obj'  fuzz ((skia)\(modules)\(skottie)\fuzz)  C:\Users\Me\Documents\skia\out\Release\obj\modules\skottie\LINK 1   
Error   MSB3073 The command "call ninja.exe -C ../../../../../out/Release/  obj/modules/skottie/fuzz.stamp" exited with code 1. fuzz ((skia)\(modules)\(skottie)\fuzz)  C:\Users\Me\Documents\skia\out\Release\obj\modules\skottie\fuzz.vcxproj 64  
Error   MSB3073 The command "call ninja.exe -C ../../../out/Release/  obj/Mech.stamp" exited with code 1.   Mech    C:\Users\Me\Documents\skia\out\Release\obj\Mech.vcxproj 536 
Error   LNK1104 cannot open file 'obj\src\pdf\pdf.SkPDFDevice.obj'  tests ((skia)\(modules)\(sksg)\tests)   C:\Users\Me\Documents\skia\out\Release\obj\modules\sksg\LINK    1   
Error   MSB3073 The command "call ninja.exe -C ../../../../../out/Release/  obj/modules/sksg/tests.stamp" exited with code 1.   tests ((skia)\(modules)\(sksg)\tests)   C:\Users\Me\Documents\skia\out\Release\obj\modules\sksg\tests.vcxproj   64  
Error   C1083   Cannot open compiler generated file: 'C:\Users\Me\Documents\skia\out\Release\obj\src\ports\skia.SkFontMgr_win_dw.obj': Permission denied    skiaserve   C:\Users\Me\Documents\skia\src\ports\SkFontMgr_win_dw.cpp   1   
Error   MSB3073 The command "call ninja.exe -C ../../../out/Release/  ./skiaserve.exe" exited with code 1.  skiaserve   C:\Users\Me\Documents\skia\out\Release\obj\skiaserve.vcxproj    134 
EN

回答 2

Stack Overflow用户

发布于 2018-11-19 03:45:16

我建议不要从视觉演播室开始建造。直接使用忍者的建筑应该能正常工作(我刚试过)。

这两个命令应该为您完成以下任务:

代码语言:javascript
复制
gn gen out\Release
ninja -C out\Release
票数 0
EN

Stack Overflow用户

发布于 2021-02-25 23:13:59

对于visual首先构建,您必须为此创建一个解决方案文件。请遵循这些程序,然后您将使用visual构建。

  • 安装Python 2.7+
  • 安装Git
  • 安装Visual
  • 下载依赖工具depot_tools,请遵循此链接
  • 将路径添加到PC的环境中,它必须在任何python路径之前。
  • 下载Skia源代码git clone https://skia.googlesource.com/skia.git
  • 输入skia cd D:/skia的源目录
  • 执行python脚本python tools/git-sync-deps
  • 将VC工具集设置为生成配置文件
  • 用Notpad++打开skia/gn/BUILDCONFIG.gn文件
  • 将win_vc = "“的值设置为VisualStudio安装目录中的VC目录。(每台计算机的路径不同)类似于我的设置:win_vc = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC"
  • 执行Visual解决方案文件
代码语言:javascript
复制
## Execute in the skia directory -> skia\bin
## Directly build Visual Studio's .sln file
> gn gen out/sln --ide=vs

现在您可以获得Visual的解决方案文件,然后使用Visual进行构建。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53046306

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档