How to resolve "relocation truncated to fit: R_X86_64_PC32 against undefined symbol `xercesc_3_1::AbstractDOMParser::adoptDocument()'"

user4815418 picture user4815418 · Nov 15, 2015 · Viewed 7.6k times · Source

I am trying to build a C++ program in Eclipse that uses a library xerces-c-3.1.1-x86_64-linux-gcc-3.4 (binary). I see the below errors ...


  1. relocation truncated to fit: R_X86_64_PC32 against undefined symbol xercesc_3_1::AbstractDOMParser::adoptDocument()

  2. undefined reference to xercesc_3_1::AbstractDOMParser::adoptDocument()


Gone through a link on stackoverflow (What does this GCC error "... relocation truncated to fit..." mean?) and understood what type of error is this but did not get a solution on how to resolve it.

Environment I am using: Cygwin64 on Windows8.1 and Eclipse configured to use Cygwin C++ compiler. Tried both xerces-c-3.1.1-x86_64-linux-gcc-3.4 as well as xerces-c-3.1.1-x86-linux-gcc-3.4 and got the same error. Am I missing something?

Answer

user4815418 picture user4815418 · Nov 28, 2015

I Solved the problem by using the libxerces-c and libxerces-c-devel from Cygwin setup (re-ran the setup with these two additional packages). I Got rid of above errors as well as signal 11 [Segmentation fault] error. These binaries are found to be suitable for Cygwin environment.