Message: "Undefined Reference to" Errors to XercesC while Compiling Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None "Undefined Reference to" Errors to XercesC while Compiling 

Forum: Installation and Configuration
Date: 05 May, 2014
From: Kolahal Bhattacharya <Kolahal Bhattacharya>

Dear All, I installed GEANT 4.9.6.p02 in my 64bit Ubuntu 12.04 (~/GEANT4.9.6 directory with source, -build, -data, -install sub-directories) using cmake. There is no problem as such regarding this installation.

Since, my applications would require GDML-based visualizations, I had installed xerces-c-3.1.1 in another directory ~/Xerces/xerces-c-3.1.1 before GEANT. During GEANT installation, I found some message like "Xerces-C found" or equivalent.

The problem is coming when I am trying to compile my code with #include "G4GDMLParser.hh". This particular code is getting compiled but while linking the executable, I am getting a lots of "undefined reference to" error messages related to xerces. If I disable #include "G4GDMLParser.hh", there is no error but in that case, I cannot get full utilization of the program: like writing the detector geometry in a .gdml file. The errors are like following:

+++++++++++++++++++++++++++++++++++++++++++++
Linking bin/inoical0_field...
obj/src/inoical0_field.o: In function `xercesc_3_1::XMLAttDefList::~XMLAttDefList()':
inoical0_field.cc:(.text._ZN11xercesc_3_113XMLAttDefListD0Ev[_ZN11xercesc_3_113XMLAttDefListD5Ev]+0x8): undefined reference to `xercesc_3_1::XMemory::operator delete(void*)'
obj/src/inoical0_field.o: In function `xercesc_3_1::DTDEntityDecl::~DTDEntityDecl()':
inoical0_field.cc:(.text._ZN11xercesc_3_113DTDEntityDeclD2Ev[_ZN11xercesc_3_113DTDEntityDeclD5Ev]+0x8): undefined reference to `xercesc_3_1::XMLEntityDecl::~XMLEntityDecl()'
obj/src/inoical0_field.o: In function `xercesc_3_1::HandlerBase::fatalError(xercesc_3_1::SAXParseException const&)':
inoical0_field.cc:(.text._ZN11xercesc_3_111HandlerBase10fatalErrorERKNS_17SAXParseExceptionE[xercesc_3_1::HandlerBase::fatalError(xercesc_3_1::SAXParseException const&)]+0x2d): undefined reference to `xercesc_3_1::SAXParseException::SAXParseException(xercesc_3_1::SAXParseException const&)'
inoical0_field.cc:(.text._ZN11xercesc_3_111HandlerBase10fatalErrorERKNS_17SAXParseExceptionE[xercesc_3_1::HandlerBase::fatalError(xercesc_3_1::SAXParseException const&)]+0x32): undefined reference to `xercesc_3_1::SAXParseException::~SAXParseException()'
inoical0_field.cc:(.text._ZN11xercesc_3_111HandlerBase10fatalErrorERKNS_17SAXParseExceptionE[xercesc_3_1::HandlerBase::fatalError(xercesc_3_1::SAXParseException const&)]+0x37): undefined reference to `typeinfo for xercesc_3_1::SAXParseException'
obj/src/inoical0_field.o: In function `xercesc_3_1::DTDEntityDecl::~DTDEntityDecl()':
inoical0_field.cc:(.text._ZN11xercesc_3_113DTDEntityDeclD0Ev[_ZN11xercesc_3_113DTDEntityDeclD5Ev]+0xc): undefined reference to `xercesc_3_1::XMLEntityDecl::~XMLEntityDecl()'
inoical0_field.cc:(.text._ZN11xercesc_3_113DTDEntityDeclD0Ev[_ZN11xercesc_3_113DTDEntityDeclD5Ev]+0x15): undefined reference to `xercesc_3_1::XMemory::operator delete(void*)'
obj/src/inoical0_field.o:(.rodata._ZTIN11xercesc_3_113DTDEntityDeclE[typeinfo for xercesc_3_1::DTDEntityDecl]+0x10): undefined reference to `typeinfo for xercesc_3_1::XMLEntityDecl'
obj/src/inoical0_field.o:(.rodata._ZTVN11xercesc_3_113XMLAttDefListE[vtable for xercesc_3_1::XMLAttDefList]+0x20): undefined reference to `xercesc_3_1::XMLAttDefList::isSerializable() const'
obj/src/inoical0_field.o:(.rodata._ZTVN11xercesc_3_113XMLAttDefListE[vtable for xercesc_3_1::XMLAttDefList]+0x28): undefined reference to `xercesc_3_1::XMLAttDefList::serialize(xercesc_3_1::XSerializeEngine&)'
obj/src/inoical0_field.o:(.rodata._ZTVN11xercesc_3_113XMLAttDefListE[vtable for xercesc_3_1::XMLAttDefList]+0x30): undefined reference to `xercesc_3_1::XMLAttDefList::getProtoType() const'
obj/src/inoical0_field.o:(.rodata._ZTVN11xercesc_3_113DTDEntityDeclE[vtable for xercesc_3_1::DTDEntityDecl]+0x20): undefined reference to `xercesc_3_1::DTDEntityDecl::isSerializable() const'
obj/src/inoical0_field.o:(.rodata._ZTVN11xercesc_3_113DTDEntityDeclE[vtable for xercesc_3_1::DTDEntityDecl]+0x28): undefined reference to `xercesc_3_1::DTDEntityDecl::serialize(xercesc_3_1::XSerializeEngine&)'
obj/src/inoical0_field.o:(.rodata._ZTVN11xercesc_3_113DTDEntityDeclE[vtable for xercesc_3_1::DTDEntityDecl]+0x30): undefined reference to `xercesc_3_1::DTDEntityDecl::getProtoType() const'
collect2: ld returned 1 exit status
make: *** [bin/inoical0_field] Error 1

+++++++++++++++++++++++++++++++++++++++++++++

It will be very helpful if some one can put some light into it. Thanks in advance,
-Kolahal

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Idea: Re: Undefined reference to Errors to XercesC while Compiling   (Michael H. Kelsey - 06 May, 2014)
1 None: Re: Undefined reference to Errors to XercesC while Compiling   (Kolahal Bhattacharya - 06 May, 2014)
(_ None: Re: Undefined reference to Errors to XercesC while Compiling   (Ben Morgan - 07 May, 2014)
(_ None: Re: Undefined reference to Errors to XercesC while Compiling   (Kolahal Bhattacharya - 07 May, 2014)
2 None: Re:   (Andrew Brown - 13 May, 2014)
1 None: Re:   (Kolahal Bhattacharya - 13 May, 2014)
1 Question: Re:   (Jincai - Apr 29, 02:06) new
2 Question: Re:   (Jincai - Apr 29, 02:08) new
 Add Message Add Message
to: ""Undefined Reference to" Errors to XercesC while Compiling"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]