Building static library on CentOS

49 views
Skip to first unread message

Yifei Bao

unread,
Jun 10, 2021, 12:21:19 PM6/10/21
to pdfium
Hi,

I'm trying to build a static library of PDFium on LInux for another project, but when I link it there's a ton of link errors. 

snapshot of the errors:
/data/home/irisyfbao/repo/pdfiumgo/third_party/pdfium/lib/libpdfium.a(t1.o): In function `opj_lrintf':
./../third_party/libopenjpeg20/opj_includes.h:176: undefined reference to `lrintf'
/data/home/irisyfbao/repo/pdfiumgo/third_party/pdfium/lib/libpdfium.a(cpwl_cbbutton.o): In function `CPWL_CBButton::~CPWL_CBButton()':
./../fpdfsdk/pwl/cpwl_cbbutton.cpp:20: undefined reference to `operator delete(void*)'
/data/home/irisyfbao/repo/pdfiumgo/third_party/pdfium/lib/libpdfium.a(cpwl_cblistbox.o): In function `CPWL_CBListBox::~CPWL_CBListBox()':
./../fpdfsdk/pwl/cpwl_cblistbox.cpp:21: undefined reference to `operator delete(void*)'
/data/home/irisyfbao/repo/pdfiumgo/third_party/pdfium/lib/libpdfium.a(cpwl_sbbutton.o): In function `CPWL_SBButton::~CPWL_SBButton()':
./../fpdfsdk/pwl/cpwl_sbbutton.cpp:23: undefined reference to `operator delete(void*)'
/data/home/irisyfbao/repo/pdfiumgo/third_party/pdfium/lib/libpdfium.a(cfx_seekablestreamproxy.o): In function `CFX_SeekableStreamProxy::~CFX_SeekableStreamProxy()':
./../core/fxcrt/cfx_seekablestreamproxy.cpp:132: undefined reference to `operator delete(void*)'
/data/home/irisyfbao/repo/pdfiumgo/third_party/pdfium/lib/libpdfium.a(cfx_xmlchardata.o): In function `CFX_XMLCharData::~CFX_XMLCharData()':
./../core/fxcrt/xml/cfx_xmlchardata.cpp:14: undefined reference to `operator delete(void*)'
/data/home/irisyfbao/repo/pdfiumgo/third_party/pdfium/lib/libpdfium.a(cfx_xmlchardata.o): In function `std::__1::__unique_if<CFX_XMLCharData>::__unique_single std::__1::make_unique<CFX_XMLCharData, fxcrt::WideString const&>(fxcrt::WideString const&)':
./../buildtools/third_party/libc++/trunk/include/memory:2006: undefined reference to `operator new(unsigned long)'
/data/home/irisyfbao/repo/pdfiumgo/third_party/pdfium/lib/libpdfium.a(cfx_xmlinstruction.o): In function `CFX_XMLInstruction::~CFX_XMLInstruction()':
./../core/fxcrt/xml/cfx_xmlinstruction.cpp:16: undefined reference to `operator delete(void*)'
/data/home/irisyfbao/repo/pdfiumgo/third_party/pdfium/lib/libpdfium.a(cfx_xmlinstruction.o): In function `std::__1::__unique_if<CFX_XMLInstruction>::__unique_single std::__1::make_unique<CFX_XMLInstruction, fxcrt::WideString const&>(fxcrt::WideString const&)':
./../buildtools/third_party/libc++/trunk/include/memory:2006: undefined reference to `operator new(unsigned long)'
/data/home/irisyfbao/repo/pdfiumgo/third_party/pdfium/lib/libpdfium.a(cfx_xmlinstruction.o): In function `void std::__1::advance<fxcrt::WideString*, unsigned long>(fxcrt::WideString*&, unsigned long)':
./../buildtools/third_party/libc++/trunk/include/iterator:695: undefined reference to `std::__1::__libcpp_debug_function'

My gn args are:
is_component_build = false
pdf_is_complete_lib = true
pdf_enable_v8 = false
pdf_is_standalone = true

Anyone knows how to solve the issue? Thanks.


Lei Zhang

unread,
Jun 10, 2021, 1:34:10 PM6/10/21
to Yifei Bao, pdfium
Your build/ dir, sysroot, and/or libc++ is broken in some way. Since
this is only happening in your copy of PDFium, I don't think others
will likely be able to track down the exact problem for you.
> --
> 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/d45f141b-8881-48cb-b16a-6bcdd0d72b9an%40googlegroups.com.

Yifei Bao

unread,
Jun 15, 2021, 8:24:36 AM6/15/21
to pdfium
Is it possible that I'm missing build dependencies because the `./build/install-build-deps.sh` does not support CentOS?

Lei Zhang

unread,
Jun 15, 2021, 1:56:43 PM6/15/21
to Yifei Bao, pdfium
It's hard to say. If you build with Ninja, add -d keeprsp so the .rsp
files used in the linking process do not get deleted. If you look in
the .rsp files, do they contain entries for files in
obj/buildtools/third_party/libc++/libc++*?
> To view this discussion on the web visit https://groups.google.com/d/msgid/pdfium/f4195cf4-9239-41c0-9b7e-c5e3dc847114n%40googlegroups.com.

Yifei Bao

unread,
Jun 16, 2021, 5:18:02 AM6/16/21
to pdfium
Yes, all the libraries are in the nasm.rsp but not in the libpdfium.a.rsp.
Reply all
Reply to author
Forward
0 new messages