<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I was able to build the PDFium lib in release mode in Windows from <a href="https://github.com/rouault/pdfium_build_gdal_3_9" id="LPlnk">
https://github.com/rouault/pdfium_build_gdal_3_9</a>. My requirement is to build the
<u>PDFium lib in DEBUG mode as well</u>. For that I updated below args in <b>args_release_win.gn
</b>with below argument</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<table data-editing-info="{"topBorderColor":"#ABABAB","bottomBorderColor":"#ABABAB","verticalBorderColor":"#ABABAB","hasHeaderRow":false,"hasFirstColumn":false,"hasBandedRows":false,"hasBandedColumns":false,"bgColorEven":null,"bgColorOdd":"#ABABAB20","headerRowColor":"#ABABAB","tableBorderFormat":0,"verticalAlign":"top"}" style="box-sizing: border-box; border-collapse: collapse; border-spacing: 0px;">
<tbody>
<tr>
<td data-editing-info="{"bgColorOverride":true}" style="width: 382px; height: 22px; border-width: 1px; border-style: solid; border-color: rgb(171, 171, 171); background-color: rgb(204, 204, 204); vertical-align: top; box-sizing: border-box;">
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 16px; color: rgb(0, 0, 0);">
<span style="background-color: rgb(255, 255, 255);"><b><i>is_debug = true</i></b><i>  # Enable debugging features.</i></span></div>
</td>
</tr>
</tbody>
</table>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<i><br>
<br>
</i>With above change. the PDFium.lib is regenerated but when I try to link it with the Debug build of GDAL 3.9.3 then I get below link errors</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<table data-editing-info="{"topBorderColor":"#ABABAB","bottomBorderColor":"#ABABAB","verticalBorderColor":"#ABABAB","hasHeaderRow":false,"hasFirstColumn":false,"hasBandedRows":false,"hasBandedColumns":false,"bgColorEven":null,"bgColorOdd":"#ABABAB20","headerRowColor":"#ABABAB","tableBorderFormat":0,"verticalAlign":"top"}" style="box-sizing: border-box; border-collapse: collapse; border-spacing: 0px;">
<tbody>
<tr>
<td data-editing-info="{"bgColorOverride":true}" style="width: 1101.83px; height: 22px; border-width: 1px; border-style: solid; border-color: rgb(171, 171, 171); background-color: rgb(204, 204, 204); vertical-align: top; box-sizing: border-box;">
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
2>pdfium.lib(fpdf_view.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in ogrpdflayer.obj</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
2>pdfium.lib(cpdf_page.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in ogrpdflayer.obj</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
2>pdfium.lib(cpdf_occontext.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in ogrpdflayer.obj</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
2>pdfium.lib(cpdf_document.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in ogrpdflayer.obj</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
2>pdfium.lib(cpdf_pagerendercontext.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in ogrpdflayer.obj</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
2>pdfium.lib(cpdf_rendercontext.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in ogrpdflayer.obj</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
2>pdfium.lib(cpdf_progressiverenderer.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in ogrpdflayer.obj</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
2>pdfium.lib(cpdf_renderoptions.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in ogrpdflayer.obj</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
2>pdfium.lib(cpdf_annotlist.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in ogrpdflayer.obj</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
2>pdfium.lib(renderdevicedriver_iface.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in ogrpdflayer.obj</div>
</td>
</tr>
</tbody>
</table>
<div><br>
</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<u>Is there a known way to fix the above errors by building PDFium.lib with required iterator_debug_level?</u> <br>
<br>
</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I also tried to enable below flag in <b>args_release_win.gn</b></div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<table data-editing-info="{"topBorderColor":"#ABABAB","bottomBorderColor":"#ABABAB","verticalBorderColor":"#ABABAB","hasHeaderRow":false,"hasFirstColumn":false,"hasBandedRows":false,"hasBandedColumns":false,"bgColorEven":null,"bgColorOdd":"#ABABAB20","headerRowColor":"#ABABAB","tableBorderFormat":0,"verticalAlign":"top"}" style="text-align: left; text-indent: 0px; box-sizing: border-box; border-collapse: collapse; border-spacing: 0px;">
<tbody>
<tr>
<td data-editing-info="{"bgColorOverride":true}" style="width: 382px; height: 22px; text-align: left; text-indent: 0px; border-width: 1px; border-style: solid; border-color: rgb(171, 171, 171); background-color: rgb(204, 204, 204); vertical-align: top; box-sizing: border-box;">
<div class="elementToProof" style="text-align: left; text-indent: 0px; margin: 0px; font-family: Calibri, Helvetica, sans-serif; font-size: 16px; color: rgb(0, 0, 0);">
<span style="background-color: rgb(255, 255, 255);"><b><i>enable_iterator_debugging=true</i></b></span></div>
</td>
</tr>
</tbody>
</table>
<div style="text-align: left; text-indent: 0px; margin: 0px; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
BUT this leads to new vector allocator related errors<br>
<br>
</div>
<table data-editing-info="{"topBorderColor":"#ABABAB","bottomBorderColor":"#ABABAB","verticalBorderColor":"#ABABAB","hasHeaderRow":false,"hasFirstColumn":false,"hasBandedRows":false,"hasBandedColumns":false,"bgColorEven":null,"bgColorOdd":"#ABABAB20","headerRowColor":"#ABABAB","tableBorderFormat":0,"verticalAlign":"top"}" style="box-sizing: border-box; border-collapse: collapse; border-spacing: 0px;">
<tbody>
<tr>
<td data-editing-info="{"bgColorOverride":true}" style="width: 1231.22px; height: 22px; border-width: 1px; border-style: solid; border-color: rgb(171, 171, 171); background-color: rgb(204, 204, 204); vertical-align: top; box-sizing: border-box;">
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
[95/1307] CXX obj/base/allocator/partition_allocator/src/partition_alloc/allocator_core/lightweight_quarantine.obj</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
FAILED: obj/base/allocator/partition_allocator/src/partition_alloc/allocator_core/lightweight_quarantine.obj</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
..\..\third_party\llvm-build\Release+Asserts\bin\clang-cl.exe /c ../../base/allocator/partition_allocator/src/partition_alloc/lightweight_quarantine.cc /Foobj/base/allocator/partition_allocator/src/partition_alloc/allocator_core/lightweight_quarantine.obj /nologo
 /showIncludes:user "-imsvc../../../../../../Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.37.32822/include" "-imsvc../../../../../../Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.37.32822/ATLMFC/include" "-imsvc../../../../../../Program
 Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/VS/include" "-imsvc../../../../../../Program Files (x86)/Windows Kits/10/include/10.0.22621.0/ucrt" "-imsvc../../../../../../Program Files (x86)/Windows Kits/10/include/10.0.22621.0/um" "-imsvc../../../../../../Program
 Files (x86)/Windows Kits/10/include/10.0.22621.0/shared" "-imsvc../../../../../../Program Files (x86)/Windows Kits/10/include/10.0.22621.0/winrt" "-imsvc../../../../../../Program Files (x86)/Windows Kits/10/include/10.0.22621.0/cppwinrt" "-imsvc../../../../../../Program
 Files (x86)/Windows Kits/NETFXSDK/4.8/include/um" -DUSE_AURA=1 -D_HAS_NODISCARD -D_CRT_NONSTDC_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE "-DCR_CLANG_REVISION=\"llvmorg-18-init-17730-gf670112a-3\"" -D_HAS_EXCEPTIONS=0
 -D__STD_C -D_CRT_RAND_S -D_CRT_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_DEPRECATE -D_ATL_NO_OPENGL -D_WINDOWS -DCERT_CHAIN_PARA_HAS_EXTRA_FIELDS -DPSAPI_VERSION=2 -DWIN32 -D_SECURE_ATL -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -DWIN32_LEAN_AND_MEAN -DNOMINMAX
 -D_UNICODE -DUNICODE -DNTDDI_VERSION=NTDDI_WIN10_NI -D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00 -D_DEBUG -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DIS_PARTITION_ALLOC_IMPL -I../.. -Igen -I../../base/allocator/partition_allocator/src -Igen/base/allocator/partition_allocator/src
 /W4 -Wimplicit-fallthrough -Wextra-semi -Wunreachable-code-aggressive -Wthread-safety -Wno-missing-field-initializers -Wno-unused-parameter -Wno-psabi -Wloop-analysis -Wno-unneeded-internal-declaration -Wno-nonportable-include-path -Wenum-compare-conditional
 -Wno-ignored-pragma-optimize -Wno-deprecated-builtins -Wno-bitfield-constant-conversion -Wno-deprecated-this-capture -Wno-invalid-offsetof -Wno-vla-extension -Wno-thread-safety-reference-return -Wshadow /WX -fno-delete-null-pointer-checks -fno-ident -fcolor-diagnostics
 -fmerge-all-constants -fcrash-diagnostics-dir=../../tools/clang/crashreports -mllvm -instcombine-lower-dbg-declare=0 -mllvm -split-threshold-for-reg-with-hint=0 /clang:-ffp-contract=off -fcomplete-member-pointers /Gy /FS /bigobj /utf-8 /Zc:twoPhase -ffile-reproducible
 /Zc:sizedDealloc- /D__WRL_ENABLE_FUNCTION_STATICS__ -fmsc-version=1934 -m64 -msse3 /Brepro -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -ffile-compilation-dir=. -no-canonical-prefixes -ftrivial-auto-var-init=pattern /Z7 -gno-codeview-command-line
 -gcodeview-ghash -Xclang -fuse-ctor-homing /guard:cf,nochecks /MDd -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wexit-time-destructors /O2 /Ob2 /Oy- /Zc:inline /Gw /clang:-fno-math-errno -Wno-c++11-narrowing-const-reference -Wno-undefined-bool-conversion
 -Wno-tautological-undefined-compare /std:c++20 -Wno-trigraphs /TP /Fd"obj/base/allocator/partition_allocator/src/partition_alloc/allocator_core_cc.pdb"</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
In file included from ../../base/allocator/partition_allocator/src/partition_alloc/lightweight_quarantine.cc:5:</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
In file included from ../../base/allocator/partition_allocator/src\partition_alloc/lightweight_quarantine.h:42:</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="background-color: rgb(255, 255, 0);"><b>../../../../../../Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.37.32822/include\vector(611,38): error: no matching conversion for static_cast from '_Alty' (aka 'InternalAllocator<partition_alloc::internal::LightweightQuarantineBranch::QuarantineSlot>')
 to '_Rebind_alloc_t<_Alty, _Container_proxy>' (aka 'InternalAllocator<std::_Container_proxy>')</b></span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="background-color: rgb(255, 255, 0);"><b>  611 |         _Mypair._Myval2._Alloc_proxy(_GET_PROXY_ALLOCATOR(_Alty, _Getal()));</b></span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
      |                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
../../../../../../Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.37.32822/include\xmemory(1492,42): note: expanded from macro '_GET_PROXY_ALLOCATOR'</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
 1492 | #define _GET_PROXY_ALLOCATOR(_Alty, _Al) static_cast<_Rebind_alloc_t<_Alty, _Container_proxy>>(_Al)</div>
</td>
</tr>
</tbody>
</table>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Any guidance?</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Even Rouault <even.rouault@spatialys.com><br>
<b>Sent:</b> Tuesday, January 14, 2025 8:32 AM<br>
<b>To:</b> Parveen Sharma <sharma1981@outlook.com>; David Klaus <dklaus@carlsonsw.com><br>
<b>Cc:</b> Michał Kowalczuk via gdal-dev <gdal-dev@lists.osgeo.org><br>
<b>Subject:</b> Re: [gdal-dev] Build GDAL PDF Driver with PDFium</font>
<div> </div>
</div>
<div>
<p><br>
</p>
<div class="x_moz-cite-prefix">Le 14/01/2025 à 01:23, Parveen Sharma a écrit :<br>
</div>
<blockquote type="cite"><style type="text/css" style="display:none">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div class="x_elementToProof" style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Thanks Even<br>
<br>
As i am building GDAL 3.9.3, so i will use the scripts in the <span style="color:rgb(41,128,185)">
<a href="https://github.com/rouault/pdfium_build_gdal_3_9" id="OWA3ad5392c-bee8-5954-e0b5-f9ef00fdcafb" class="x_reference x_external x_OWAAutoLink x_moz-txt-link-freetext" style="color:rgb(41,128,185); text-align:left">https://github.com/rouault/pdfium_build_gdal_3_9</a></span> repository
 to build a patched version of PDFium.<br>
<br>
Would you recommend using the "master" OR the "pdfium_6309_v1" branch of the above repository? I need to build GDAL with PDF Dynamic driver  in both Windows and Linux.</div>
</blockquote>
<p>They're the same (except an edit in the readme file that doesn't matter as far as doing builds is concerned)</p>
<br>
<pre class="x_moz-signature" cols="72">-- 
<a class="x_moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.
Butcher of all kinds of standards, open or closed formats. At the end, this is just about bytes.</pre>
</div>
</body>
</html>