0

I came across this error when I tried to compile a project that used xerces-c library(binaries). Since this is a binary it does not come with ./configure and hence I skipped doing the same(./configure). I am providing the xerces-c files as include and library to my xml reading program as anyone would normally do. The only error left is as below...

--Error output ---

Building target: MyXmlProject.exe
Invoking: Cygwin C++ Linker
g++ -L"C:\cppLib\xerces-c-3.1.1-x86_64-linux-gcc-3.4\lib" -o "MyXmlProject.exe"  ./xmldom/XmlDomDocument.o ./xmldom/main.o   -lxerces-c

collect2: error: ld terminated with signal 11 [Segmentation fault], core dumped
/usr/lib/gcc/x86_64-pc-cygwin/4.9.3/../../../../x86_64-pc-cygwin/bin/ld: BFD (GNU Binutils) 2.25 assertion fail /cygdrive/i/szsz/tmpp/cygwin64/binutils/binutils-2.25-1.x86_64/src/binutils-gdb/bfd/cofflink.c:264
makefile:48: recipe for target 'MyXmlProject.exe' failed
make: *** [MyXmlProject.exe] Error 1

I had downloaded the binaries from http://archive.apache.org/dist/xerces/c/3/binaries/ I have tried with a. xerces-c-3.1.1-x86_64-linux-gcc-3.4 and b. xerces-c-3.1.1-x86-linux-gcc-3.4 both the files but both result in same error.

Seems that the above two binaries are compiled for different platform and do not work on windows. The environment I am using is eclipse, cygwin64 on windows8.1. Can someone tell me which binary should I take so that the error is resolved?

The other options are tedious and wanted to avoid those. People who wants to know how I came across this error and other options please refer to How to resolve "relocation truncated to fit: R_X86_64_PC32 against undefined symbol `xercesc_3_1::AbstractDOMParser::adoptDocument()'"

Community
  • 1
  • 1
  • 1
    Well it says "linux" right there in the name. Why do you think it will work on Windows? – n. m. could be an AI Nov 22 '15 at 06:31
  • @nm- I m using cygwin gcc compiler and earlier I thought this binary may work but I was not sure. Is there a binary available that will work on Cygwin? I did not take those having the name like windows-vc (I suppose they are built for MS Visual C and not free). Can you tell me which binary to take? –  Nov 23 '15 at 08:48
  • 1
    Try your cygwin /setup.exe, it should have libxerces-c-devel package. – n. m. could be an AI Nov 23 '15 at 09:21
  • @nm- thanks, Earlier i had just installed packages in devel category. When I run cygwin setup again I see below packages coming under Libs category 1. libxerces-c-devel and 2. libxerces-c31. Let me try these. –  Nov 23 '15 at 12:20
  • @nm- A bit more help needed. my /usr/include directory has added xercesc folder. Do I need to first compile(using ./configure) xercesc before using that in my xml reading program? How to be sure that xercesc folder contains source or binaries? Thanks –  Nov 23 '15 at 12:32
  • 1
    No, you have it installed already, compile your program only. – n. m. could be an AI Nov 23 '15 at 13:01
  • @nm- I don't see the lib file(.a file) there. And without it gives 1. "relocation truncated to fit" and 2. undefined reference errors. Tried libxerces-c.dll.a but same error. –  Nov 23 '15 at 15:00
  • 1
    Did you install libxerces-c along with libxerces-c-devel? – n. m. could be an AI Nov 24 '15 at 13:07
  • @nm- I installed both –  Nov 24 '15 at 15:56
  • @nm- Eclipse was using its own makefile which was producing errors. I am now using makefile that is simpler and now running fine without errors. Solved using the libxerces-c and libxerces-c-devel from Cygwin setup. Thanks nm. –  Nov 28 '15 at 12:09

0 Answers0