pdfium build failed with visual studio 2019

163 views
Skip to first unread message

Shawn

unread,
Mar 15, 2021, 1:08:03 PM3/15/21
to pdfium
Hi, 
Try to build PDFium with Microsoft Visual Studio Enterprise 2019 (Version 16.9.1) and got error. Any help would be appreciated.
My args.gn :
# Build arguments go here.
# See "gn args <out_dir> --list" for available build arguments.
is_debug = false # Enable debugging features.
is_clang = false

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

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 = true # Disable component build (must be false)
use_custom_libcxx = false
pdf_use_win32_gdi = true
clang_use_chrome_plugins = false  # Currently must be false.

And error details:
c:\repo\pdfium>ninja -C out\release pdfium
ninja: Entering directory `out\release'
[0/1] Regenerating ninja files
[6/914] CXX obj/v8/v8_base_without_compiler/api.obj
FAILED: obj/v8/v8_base_without_compiler/api.obj
ninja -t msvc -e environment.x64 -- "C:\Program Files (x86)\Microsoft Visual Stu
dio\2019\Enterprise\VC\Tools\MSVC\14.28.29910\bin\HostX64\x64/cl.exe" /nologo /s
howIncludes -DUSE_AURA=1 -D_HAS_EXCEPTIONS=0 -DCOMPONENT_BUILD -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_VB -D_WIN32_WINNT=0x0A00 -DWINVE
R=0x0A00 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DV8_TYPED_ARRAY_M
AX_SIZE_IN_HEAP=64 -DENABLE_MINOR_MC -DV8_INTL_SUPPORT -DENABLE_HANDLE_ZAPPING -
DV8_USE_EXTERNAL_STARTUP_DATA -DV8_ATOMIC_OBJECT_FIELD_WRITES -DV8_ATOMIC_MARKIN
G_STATE -DV8_ENABLE_LAZY_SOURCE_POSITIONS -DV8_WIN64_UNWINDING_INFO -DV8_ENABLE_
REGEXP_INTERPRETER_THREADED_DISPATCH -DV8_SNAPSHOT_COMPRESSION -DV8_COMPRESS_POI
NTERS -DV8_31BIT_SMIS_ON_64BIT_ARCH -DV8_DEPRECATION_WARNINGS -DV8_IMMINENT_DEPR
ECATION_WARNINGS -DCPPGC_CAGED_HEAP -DV8_TARGET_ARCH_X64 -DV8_HAVE_TARGET_OS -DV
8_TARGET_OS_WIN -DDISABLE_UNTRUSTED_CODE_MITIGATIONS -DBUILDING_V8_SHARED -DV8_C
OMPRESS_POINTERS -DV8_31BIT_SMIS_ON_64BIT_ARCH -DV8_DEPRECATION_WARNINGS -DV8_IM
MINENT_DEPRECATION_WARNINGS -DCPPGC_CAGED_HEAP -DUSING_V8_BASE_SHARED -DUSING_V8
_PLATFORM_SHARED -DV8_COMPRESS_POINTERS -DV8_31BIT_SMIS_ON_64BIT_ARCH -DV8_DEPRE
CATION_WARNINGS -DV8_IMMINENT_DEPRECATION_WARNINGS -DCPPGC_CAGED_HEAP -DU_USING_
ICU_NAMESPACE=0 -DU_ENABLE_DYLOAD=0 -DUSE_CHROMIUM_ICU=1 -DU_ENABLE_TRACING=1 -D
U_ENABLE_RESOURCE_TRACING=0 -DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE -DUCHAR_TYPE
=wchar_t -I../.. -Igen -I../../v8 -I../../v8/include -Igen/v8 -Igen/v8/include -
Igen/v8/include -I../../v8/include -I../../v8/include -Igen/v8/include -I../../t
hird_party/icu/source/common -I../../third_party/icu/source/i18n -I../../v8/incl
ude -I../../third_party/zlib /Gy /FS /bigobj /utf-8 /Zc:sizedDealloc- /wd4117 /D
__DATE__= /D__TIME__= /D__TIMESTAMP__= /W4 /WX /wd4091 /wd4127 /wd4251 /wd4275 /
wd4312 /wd4324 /wd4351 /wd4355 /wd4503 /wd4589 /wd4611 /wd4100 /wd4121 /wd4244 /
wd4505 /wd4510 /wd4512 /wd4610 /wd4838 /wd4995 /wd4996 /wd4456 /wd4457 /wd4458 /
wd4459 /wd4200 /wd4201 /wd4204 /wd4221 /wd4245 /wd4267 /wd4305 /wd4389 /wd4702 /
wd4701 /wd4703 /wd4661 /wd4706 /wd4715 /Zi /MD /wd4245 /wd4267 /wd4324 /wd4701 /
wd4702 /wd4703 /wd4709 /wd4714 /wd4715 /wd4718 /wd4723 /wd4724 /wd4800 /wd4506 /
O2 /Ob2 /Oy- /Zc:inline /Gw /TP /wd4577 /GR- /c ../../v8/src/api/api.cc /Foobj/v
8/v8_base_without_compiler/api.obj /Fd"obj/v8/v8_base_without_compiler_cc.pdb"
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.
28.29910\include\xutility(4421): error C2280: 'std::unique_ptr<cppgc::CustomSpac
eBase,std::default_delete<cppgc::CustomSpaceBase>> &std::unique_ptr<cppgc::Custo
mSpaceBase,std::default_delete<cppgc::CustomSpaceBase>>::operator =(const std::u
nique_ptr<cppgc::CustomSpaceBase,std::default_delete<cppgc::CustomSpaceBase>> &)
': attempting to reference a deleted function
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.
28.29910\include\memory(3434): note: see declaration of 'std::unique_ptr<cppgc::
CustomSpaceBase,std::default_delete<cppgc::CustomSpaceBase>>::operator ='
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.
28.29910\include\memory(3434): note: 'std::unique_ptr<cppgc::CustomSpaceBase,std
::default_delete<cppgc::CustomSpaceBase>> &std::unique_ptr<cppgc::CustomSpaceBas
e,std::default_delete<cppgc::CustomSpaceBase>>::operator =(const std::unique_ptr
<cppgc::CustomSpaceBase,std::default_delete<cppgc::CustomSpaceBase>> &)': functi
on was explicitly deleted
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.
28.29910\include\vector(1134): note: see reference to function template instanti
ation '_OutIt *std::_Copy_unchecked<_Iter,std::unique_ptr<cppgc::CustomSpaceBase
,std::default_delete<cppgc::CustomSpaceBase>>*>(_InIt,_InIt,_OutIt)' being compi
led
        with
        [
            _OutIt=std::unique_ptr<cppgc::CustomSpaceBase,std::default_delete<cp
pgc::CustomSpaceBase>> *,
            _Iter=std::unique_ptr<cppgc::CustomSpaceBase,std::default_delete<cpp
gc::CustomSpaceBase>> *,
            _InIt=std::unique_ptr<cppgc::CustomSpaceBase,std::default_delete<cpp
gc::CustomSpaceBase>> *
        ]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.
28.29910\include\vector(1149): note: see reference to function template instanti
ation 'void std::vector<std::unique_ptr<cppgc::CustomSpaceBase,std::default_dele
te<cppgc::CustomSpaceBase>>,std::allocator<std::unique_ptr<cppgc::CustomSpaceBas
e,std::default_delete<cppgc::CustomSpaceBase>>>>::_Assign_range<_Iter>(_Iter,_It
er,std::forward_iterator_tag)' being compiled
        with
        [
            _Iter=std::unique_ptr<cppgc::CustomSpaceBase,std::default_delete<cpp
gc::CustomSpaceBase>> *
        ]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.
28.29910\include\vector(1149): note: see reference to function template instanti
ation 'void std::vector<std::unique_ptr<cppgc::CustomSpaceBase,std::default_dele
te<cppgc::CustomSpaceBase>>,std::allocator<std::unique_ptr<cppgc::CustomSpaceBas
e,std::default_delete<cppgc::CustomSpaceBase>>>>::_Assign_range<_Iter>(_Iter,_It
er,std::forward_iterator_tag)' being compiled
        with
        [
            _Iter=std::unique_ptr<cppgc::CustomSpaceBase,std::default_delete<cpp
gc::CustomSpaceBase>> *
        ]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.
28.29910\include\vector(1160): note: see reference to function template instanti
ation 'void std::vector<std::unique_ptr<cppgc::CustomSpaceBase,std::default_dele
te<cppgc::CustomSpaceBase>>,std::allocator<std::unique_ptr<cppgc::CustomSpaceBas
e,std::default_delete<cppgc::CustomSpaceBase>>>>::assign<std::unique_ptr<cppgc::
CustomSpaceBase,std::default_delete<cppgc::CustomSpaceBase>>*,0>(_Iter,_Iter)' b
eing compiled
        with
        [
            _Iter=std::unique_ptr<cppgc::CustomSpaceBase,std::default_delete<cpp
gc::CustomSpaceBase>> *
        ]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.
28.29910\include\vector(1160): note: see reference to function template instanti
ation 'void std::vector<std::unique_ptr<cppgc::CustomSpaceBase,std::default_dele
te<cppgc::CustomSpaceBase>>,std::allocator<std::unique_ptr<cppgc::CustomSpaceBas
e,std::default_delete<cppgc::CustomSpaceBase>>>>::assign<std::unique_ptr<cppgc::
CustomSpaceBase,std::default_delete<cppgc::CustomSpaceBase>>*,0>(_Iter,_Iter)' b
eing compiled
        with
        [
            _Iter=std::unique_ptr<cppgc::CustomSpaceBase,std::default_delete<cpp
gc::CustomSpaceBase>> *
        ]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.
28.29910\include\vector(1157): note: while compiling class template member funct
ion 'void std::vector<std::unique_ptr<cppgc::CustomSpaceBase,std::default_delete
<cppgc::CustomSpaceBase>>,std::allocator<std::unique_ptr<cppgc::CustomSpaceBase,
std::default_delete<cppgc::CustomSpaceBase>>>>::_Copy_assign(const std::vector<s
td::unique_ptr<cppgc::CustomSpaceBase,std::default_delete<cppgc::CustomSpaceBase
>>,std::allocator<std::unique_ptr<cppgc::CustomSpaceBase,std::default_delete<cpp
gc::CustomSpaceBase>>>> &,std::false_type)'
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.
28.29910\include\vector(1176): note: see reference to function template instanti
ation 'void std::vector<std::unique_ptr<cppgc::CustomSpaceBase,std::default_dele
te<cppgc::CustomSpaceBase>>,std::allocator<std::unique_ptr<cppgc::CustomSpaceBas
e,std::default_delete<cppgc::CustomSpaceBase>>>>::_Copy_assign(const std::vector
<std::unique_ptr<cppgc::CustomSpaceBase,std::default_delete<cppgc::CustomSpaceBa
se>>,std::allocator<std::unique_ptr<cppgc::CustomSpaceBase,std::default_delete<c
ppgc::CustomSpaceBase>>>> &,std::false_type)' being compiled
c:\repo\pdfium\v8\include\cppgc/heap.h(124): note: see reference to class templa
te instantiation 'std::vector<std::unique_ptr<cppgc::CustomSpaceBase,std::defaul
t_delete<cppgc::CustomSpaceBase>>,std::allocator<std::unique_ptr<cppgc::CustomSp
aceBase,std::default_delete<cppgc::CustomSpaceBase>>>>' being compiled
[11/914] CXX obj/v8/v8_base_without_compiler/builtins.obj
ninja: build stopped: subcommand failed.



Daniel Hosseinian

unread,
Mar 15, 2021, 1:38:02 PM3/15/21
to Shawn, Thomas Sepez, pdfium
+tsepez@

Seems like this might have been affected by work around XFA,

Is it imperative that you build with XFA right now? I think you'd be able to get around these build errors if you set `pdf_enable_xfa = false`, at least until we find a fix.

If that doesn't work, also try `pdf_enable_v8 = false`.

--
You received this message because you are subscribed to the Google Groups "pdfium" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pdfium+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pdfium/149a529e-0b4a-42e1-8b7c-7994201b3949n%40googlegroups.com.


--
Google Logo
Daniel Hosseinian
Software Engineer
dh...@google.com
+1 424-341-4575

Joe Wezorek

unread,
Mar 15, 2021, 2:13:38 PM3/15/21
to Shawn, pdfium
Google's whole set up for building pdfium is not geared toward building on Windows via Visual Studio. If there are errors it isnt surprising. 

However, all the pdfium code is perfectly generic, standard C++11. But there are a lot of files and there is a little weirdness with the dependencies, but like it is not *that* big a deal to just pull the code and then set it up as a Solution in Visual Studio "by hand". 

I have done that here: https://github.com/jwezorek/vs_pdfium 
and that repo is now very up to date in terms of when I pulled the code

Joe


On Mon, Mar 15, 2021 at 10:08 AM Shawn <caox...@gmail.com> wrote:

Daniel Hosseinian

unread,
Mar 15, 2021, 2:23:13 PM3/15/21
to Joe Wezorek, Shawn, pdfium
Re: V8 roll

Actually, it seems like we haven't yet for this month.

I see that nigi@ is trying a V8 roll [1], but it's failing to compile on the XFA MSVC bots 😥

Let me see if we can resolve that sooner than later.

Daniel Hosseinian

unread,
Mar 15, 2021, 2:25:08 PM3/15/21
to Joe Wezorek, Shawn, pdfium
Reply all
Reply to author
Forward
0 new messages