Cannot build PDFium on Windows

517 views
Skip to first unread message

Ralf S.

unread,
Dec 5, 2016, 11:56:38 AM12/5/16
to pdfium
Hi there,

I'm trying to build PDFium from Canary (chromium/2939 tag) using the latest Visual Studio 2015 on Windows 10, and I keep running into an error while building ICU. Here's what I'm doing:

gclient config --unmanaged --spec "solutions=[{'name':'pdfium','url':'https://pdfium.googlesource.com/pdfium.git@chromium/2939','deps_file':'DEPS','managed':False,'custom_deps':{},'safesync_url':''}]"
gclient sync
cd pdfium
gn gen out/Debug --args="pdf_enable_xfa=false pdf_enable_v8=true target_cpu=\"x86\""
ninja -C out/Debug pdfium

Eventually, I get this error:

[469/1444] CXX obj/third_party/icu/icui18n/calendar.obj
FAILED: obj/third_party/icu/icui18n/calendar.obj
ninja -t msvc -e environment.x86 -- "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64_x86/cl.exe" /nologo /showIncludes /FC @obj/third_party/icu/icui18n/calendar.obj.rsp /c ../../third_party/icu/source/i18n/calendar.cpp /Foobj/third_party/icu/icui18n/calendar.obj /Fd"obj/third_party/icu/icui18n_cc.pdb"
z:\development\pdfium\win\2939\pdfium\third_party\icu\source\common\unicode\utypes.h(415): error C2220: warning treated as error - no 'object' file generated
z:\development\pdfium\win\2939\pdfium\third_party\icu\source\common\unicode\utypes.h(415): warning C4595: 'operator new': non-member operator new or delete functions may not be declared inline
z:\development\pdfium\win\2939\pdfium\third_party\icu\source\common\unicode\utypes.h(415): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings
z:\development\pdfium\win\2939\pdfium\third_party\icu\source\common\unicode\utypes.h(431): warning C4595: 'operator new[]': non-member operator new or delete functions may not be declared inline
z:\development\pdfium\win\2939\pdfium\third_party\icu\source\common\unicode\utypes.h(431): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings
z:\development\pdfium\win\2939\pdfium\third_party\icu\source\common\unicode\utypes.h(443): warning C4595: 'operator delete': non-member operator new or delete functions may not be declared inline
z:\development\pdfium\win\2939\pdfium\third_party\icu\source\common\unicode\utypes.h(443): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings
z:\development\pdfium\win\2939\pdfium\third_party\icu\source\common\unicode\utypes.h(454): warning C4595: 'operator delete[]': non-member operator new or delete functions may not be declared inline
z:\development\pdfium\win\2939\pdfium\third_party\icu\source\common\unicode\utypes.h(454): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings
c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_new.h(34): warning C4595: 'operator new': non-member operator new or delete functions may not be declared inline
c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_new.h(34): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings
c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_new.h(45): warning C4595: 'operator new[]': non-member operator new or delete functions may not be declared inline
c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_new.h(45): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings
c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_new.h(55): warning C4595: 'operator delete': non-member operator new or delete functions may not be declared inline
c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_new.h(55): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings
c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_new.h(64): warning C4595: 'operator delete[]': non-member operator new or delete functions may not be declared inline
c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime_new.h(64): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings
ninja: build stopped: subcommand failed.

Any idea what's wrong? Would it help to roll ICU to a newer revision in DEPS?

Ralf

Wei Li

unread,
Dec 5, 2016, 12:16:22 PM12/5/16
to Ralf S., pdfium
Try add "pdf_is_standalone = true" and "is_component_build = false"? 

Here is the recommended configuration:


--
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+unsubscribe@googlegroups.com.
To post to this group, send email to pdf...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pdfium/200dff29-7e7e-4c4c-9ff0-9fb4610c6d80%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ralf S.

unread,
Dec 6, 2016, 5:20:56 PM12/6/16
to pdfium, ralf....@gmail.com
Your suggestion works, but I'm afraid it is not an option for me because I need to build PDFium as libraries. The v8 DLL for example is missing after the build process completes.

The error I described occurs because some warning in ICU is being treated as an error. Until a few weeks ago, this warning was ignored (via a cflag), but then the "build" part was rolled to a newer revision and in the meantime, the cflag was removed, see here: https://bugs.chromium.org/p/chromium/issues/detail?id=593448, because the issue causing the warning was fixed in ICU. Unfortunately, PDFium uses an older ICU revision.

I just changed icu_revision in DEPS to the newest revision, dda089a98a4f1512a62a68e8fc47a98aa6d2f963 (which BTW is also used by Canary, see here: https://chromium.googlesource.com/chromium/src.git/+/57.0.2939.1/DEPS#109), and this fixes the issue.

Any reason why PDFium uses that particular ICU revision?
To unsubscribe from this group and stop receiving emails from it, send an email to pdfium+un...@googlegroups.com.

Dan Sinclair

unread,
Dec 7, 2016, 9:13:57 AM12/7/16
to Ralf S., pdfium
On Tue, Dec 6, 2016 at 5:20 PM Ralf S. <ralf....@gmail.com> wrote:
The error I described occurs because some warning in ICU is being treated as an error. Until a few weeks ago, this warning was ignored (via a cflag), but then the "build" part was rolled to a newer revision and in the meantime, the cflag was removed, see here: https://bugs.chromium.org/p/chromium/issues/detail?id=593448, because the issue causing the warning was fixed in ICU. Unfortunately, PDFium uses an older ICU revision.

I just changed icu_revision in DEPS to the newest revision, dda089a98a4f1512a62a68e8fc47a98aa6d2f963 (which BTW is also used by Canary, see here: https://chromium.googlesource.com/chromium/src.git/+/57.0.2939.1/DEPS#109), and this fixes the issue.


I think it would make sense for us to update our ICU to match whatever Chromium has. If Chromium has updated, then lets go to the same revision.

dan
 

Ralf S.

unread,
Dec 9, 2016, 5:58:28 AM12/9/16
to pdfium, ralf....@gmail.com
On Wednesday, December 7, 2016 at 3:13:57 PM UTC+1, Dan Sinclair wrote:
I think it would make sense for us to update our ICU to match whatever Chromium has. If Chromium has updated, then lets go to the same revision.


Dan, is there anything I can do to help push this forward, e.g. provide a patch for the DEPS file? (On Github, I'd submit a pull request...)

Dan Sinclair

unread,
Dec 12, 2016, 10:03:07 AM12/12/16
to Ralf S., pdfium

codereview.chromium.org/2568113002 is out for review. Grabbed the ICU revision from current chromium which is a bit different then the one you posted.

Dan


--
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 post to this group, send email to pdf...@googlegroups.com.

rsippl

unread,
Dec 13, 2016, 2:41:25 AM12/13/16
to pdfium, ralf....@gmail.com
On Monday, December 12, 2016 at 4:03:07 PM UTC+1, Dan Sinclair wrote:

codereview.chromium.org/2568113002 is out for review. Grabbed the ICU revision from current chromium which is a bit different then the one you posted.


Seems ICU added a few fixes lately, now we also have those in PDFium.

Dan, this works fine for me, thanks!

Lesson learned: when components get out of sync, weird things can happen ;)
Reply all
Reply to author
Forward
0 new messages