VS2017 编译pdfium
1、本地创建google目录,进入 
2、下载
mkdir google
cd google
gclient config --unmanaged https://pdfium.googlesource.com/pdfium.git
gclient sync

3、修改DEBUG_LEVEL
在DEBUG模式下编译时,会报:
#error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2'

buid/config/BUILD.gn
  
  if (is_win) {
    if (!enable_iterator_debugging && !use_custom_libcxx) {
      # Iterator debugging is enabled by default by the compiler on debug
      # builds, and we have to tell it to turn it off.
      #将原来的_HAS_ITERATOR_DEBUGGING=0修改为以下:(确保DEBUG模式时,_ITERATOR_DEBUG_LEVEL为2)
      defines += [ "_HAS_ITERATOR_DEBUGGING=1" ]
      defines += [ "_ITERATOR_DEBUG_LEVEL=2" ]
    }

修改:pdfium/BUILD.gn

config("pdfium_public_config") {
  defines = []

if (pdf_enable_v8) {
    defines += [ "PDF_ENABLE_V8" ]

if (pdf_enable_xfa) {
      defines += [ "PDF_ENABLE_XFA" ]
      if (pdf_enable_xfa_bmp) {
        defines += [ "PDF_ENABLE_XFA_BMP" ]
      }
      if (pdf_enable_xfa_gif) {
        defines += [ "PDF_ENABLE_XFA_GIF" ]
      }
      if (pdf_enable_xfa_png) {
        defines += [ "PDF_ENABLE_XFA_PNG" ]
      }
      if (pdf_enable_xfa_tiff) {
        defines += [ "PDF_ENABLE_XFA_TIFF" ]
      }
      
      if(is_debug){
        #增加debug级别
        defines += ["_DEBUG"]
        defines += ["_HAS_ITERATOR_DEBUGGING=1"]
        defines += ["_ITERATOR_DEBUG_LEVEL=2"] 
      }
    }
  }

4、生成工程
官方:
#lease refer to Chromium's Visual Studio set up for requirements and instructions on build environment configuration.
#Run set DEPOT_TOOLS_WIN_TOOLCHAIN=0, or set that variable in your global environment.
#Compilation is done through Ninja, not Visual Studio.
use_goma = true  # Googlers only. Make sure goma is installed and running first.
is_debug = true  # Enable debugging features.

# Set true to enable experimental Skia backend.
pdf_use_skia = false
# Set true to enable experimental Skia backend (paths only).
pdf_use_skia_paths = false

pdf_enable_xfa = true  # Set false to remove XFA support (implies JS support).
pdf_enable_v8 = true  # Set false to remove Javascript support.
pdf_is_standalone = true  # Set for a non-embedded build.
is_component_build = false # Disable component build (Though it should work)

clang_use_chrome_plugins = false  # Currently must be false.
For sample applications like pdfium_test to build, one must set pdf_is_standalone = true.

By default, the entire project builds with C++14, because features like V8 support, XFA support, and the Skia backend all have dependencies on libraries that require C++14. If one does not need any of those features, and need to fall back to building in C++11 mode, then set use_cxx11 = true. This fallback is temporary and will go away in the future when PDFium fully transitions to C++14. See this bug for details.

When complete the arguments will be stored in <directory>/args.gn, and GN will automatically use the new arguments to generate build files. Should your files fail to generate, please double-check that you have set use_sysroot as indicated above.
===============
执行:

cd pdfium
set DEPOT_TOOLS_WIN_TOOLCHAIN=0
gn args out/x86
在弹出窗口中,贴:
#Buildargumentsgohere.
#See"gnargs<out_dir>--list"foravailablebuildarguments.

#是否启用goma支持
use_goma=false

#是否编译为Chrome插件
clang_use_chrome_plugins=false

#是否进行编译测试
pdf_is_standalone=true

#是否启用skia支持
pdf_use_skia=false
pdf_use_skia_paths=false

#true编译为debug版本,false编译为release版本
is_debug=true

#true编译为动态库 /MD,/MDd,false编译为静态库 /MT,/MTd
is_component_build=false

#编译为一个独立的静态库(is_component_build必须为false)
#pdf_is_complete_lib为false时,编译为多个静态库,true编译为一个独立的静态库
pdf_is_complete_lib=true

#xfa支持
pdf_enable_xfa=true

#v8支持
pdf_enable_v8=true

#cpu架构;x86、x64可选
target_cpu="x86"

#true将用clang进行编译,false将用VS2017编译
is_clang=false

5、编译pdfium

cd pdfium
ninja -C out/x86 pdfium

编译时间较长,DEBUG结果有900MB以上,RELEASE结果有600M左右

win10 下 pdfium编译 VS2017相关推荐

  1. windows 10下VS2019编译mongoDB c、c++API(win10下vs2019编译mongo c++)

    1.windows 10下安装 git git clone https://github.com/mongodb/mongo-c-driver.git 拖到本地,然后mkdir cmake_build ...

  2. win10下解决编译环境find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer

    在新电脑上用的win10系统,但是装完编译环境后,编译时一直出现个警告find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer,自己一脸懵逼. ...

  3. zlib / win10 下 vs2019 编译 zlib 的方法

    一.准备 官网下载 zlib 库源代码.(点我) 二.设置 1.进入源码根目录,双击打开 contrib \ vstudio \ vc14 \ zlibvc.sln. 2.初始编译时,会报错: 无法生 ...

  4. win10下vs2015编译的程序如何运行在win7等系统(无需安装Redistributable)

    先上解决方法:找到对应的ucrtbase.dll,也拷贝 vs2015做的项目本以为像之前的vs版本一样把msvcrXXX140.dll还有另外几个运行时库都放到exe旁边即可,然并卵...,在win ...

  5. Win10下用VS2017编译live555

    Win7下使用VS2013编译live555 一.live555简介 live555是一个为流媒体提供解决方案的跨平台C++开源项目,它实现了对标准流媒体传输协议如RTP/RTCP.RTSP.SIP等 ...

  6. VS2017 + Win10 下的 OpenCPN 5.0.0 编译过程小结

    本文介绍了OpenCPN 5.0.0版本的编译过程,官方网站给出了一个流程,但是亲测后发现还是有一些小坑,官方给出的命令行操作由于网络(可能需要科学上网)不一定畅通,导致难以下载成功,在此把本人成功配 ...

  7. win10下编译和使用mnn 2021

    mnn版本1.2.0 Ubuntu子系统下Android编译教程,亲测ok: MNN编译android_jacke121的专栏-CSDN博客 编译转换工具: mnn 编译转换工具 win10 2021 ...

  8. win10下编译安装ncnn

    win10下编译安装ncnn 第一步 自行安装VS2017.CMake软件. Cmake可以在网盘自取: 链接:https://pan.baidu.com/s/16w_ZVHDb4_y-56WmDHM ...

  9. 跑yolo3模型出的效果图_【目标检测实战】Darknet入门—yolov3模型训练(Win10下的安装、编译、实现)...

    效果图 简介 Yolo,是实时物体检测的算法系统,基于Darknet-一个用C和CUDA编写的开源神经网络框架.它快速,易于安装,并支持CPU和GPU计算,也是yolo的底层.本文主要介绍在win10 ...

最新文章

  1. 新来了个技术总监:谁再用 @Async 创建线程以后就不用来了!!
  2. 010——VUE中使用lodash库减少watch对后台请求的压力
  3. JVM年轻代,老年代,永久代详解
  4. 自动装箱与自动拆箱的一些问题
  5. 讨论下直博和读完硕士再读博,在能力上的差距
  6. 通过JNI使用C ++尖叫快速进行Lucene搜索
  7. matlab 进度条/waitbar 显示运行进度
  8. python-24: re 模块 之二 re方法及反斜杠
  9. linux连接u盘是提示usb驱动错误,U盘提示无法访问,由于I/O设备错误,无法运行此项请求3种完美解决办法...
  10. 分析SpinnerActivityTest中有关控件操作以及UI线程问题
  11. iOS开发之iOS11频繁刷新TableView向下偏移的问题
  12. [BZOJ 4010] 菜肴制作
  13. Visual Studio 创建C语言项目
  14. 在软件测试中UT,IT,ST,UAT分别是什么意思
  15. 【Java面试题】线程的生命周期包括哪几个阶段?
  16. [DeFRCN] Decouple Faster R-CNN for Few-Shot Object Detection(ICCV 2021)
  17. 关于轻量级知识共享平台mm-wiki的使用
  18. 2021张家界五一出行攻略
  19. Linux 下文件和目录的特点
  20. 监控安防人员入门基础

热门文章

  1. 风投是如何逆势布局DeFi项目的?
  2. 【中控技术加持荣信化工智能工厂,尽显科技范儿】
  3. 韶音骨传导耳机怎么样?南卡旗舰和韶音旗舰横评对比,区别在这些方面
  4. 【原创】AE菜单中英文对照完全版(贴图打包下载)
  5. mysql sql loader_Data Loader
  6. 课程在线学习的小程序
  7. 台积电市值超越腾讯阿里,成为亚洲第一,互联网不香了?
  8. 骚年,看我如何把 PhantomJS 图片的 XSS 升级成 SSRF/LFR
  9. 风影ASP.NET基础教学 13 NET3.0特性补充
  10. 新手做电商直播带货怎么和快递合作谈价格